Skip to content

Commit

Permalink
#84 Refactoring Code PHP CS FIXER
Browse files Browse the repository at this point in the history
  • Loading branch information
bfoujols committed Apr 21, 2023
1 parent 365f005 commit 19c5012
Show file tree
Hide file tree
Showing 39 changed files with 833 additions and 811 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ vendor/**
### Testing
tests/result/**
.phpunit.result.cache
.php-cs-fixer.cache

.mstud.lock
1,556 changes: 793 additions & 763 deletions clover.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/App.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace Studoo;

use Studoo\Service\Command\CommandBanner;
Expand All @@ -20,4 +21,3 @@ public function __construct()
$this->setDefaultCommand('default');
}
}

3 changes: 1 addition & 2 deletions src/Command/CommandManage.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;


class CommandManage extends Command
{
protected static SymfonyStyle $stdOutput;
Expand All @@ -39,4 +38,4 @@ public static function getStdOutPut(): SymfonyStyle
return self::$stdOutput;
}

}
}
2 changes: 1 addition & 1 deletion src/Command/CreateFileDefaultCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}
return Command::FAILURE;
}
}
}
3 changes: 1 addition & 2 deletions src/Command/CreateStudentCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

class CreateStudentCommand extends CommandManage
{

protected static $defaultName = 'student:dir';
protected static $defaultDescription = 'Création des repertoires des étudiants';

Expand Down Expand Up @@ -69,4 +68,4 @@ protected function execute(InputInterface $input, OutputInterface $output): int

return Command::SUCCESS;
}
}
}
2 changes: 1 addition & 1 deletion src/Command/DefaultCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ protected function execute(InputInterface $input, OutputInterface $output): int

return Command::SUCCESS;
}
}
}
2 changes: 1 addition & 1 deletion src/Command/ValidationStudentCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ protected function execute(InputInterface $input, OutputInterface $output): int
return Command::SUCCESS;

}
}
}
2 changes: 1 addition & 1 deletion src/Entity/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ public function setDateCreated(\DateTime $dateTime): Import
$this->dateCreated = $dateTime;
return $this;
}
}
}
3 changes: 1 addition & 2 deletions src/Entity/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use Studoo\Exception\InvalideArgumentException;


class Repository
{
private string $id;
Expand Down Expand Up @@ -75,4 +74,4 @@ public function setDateCreated(\DateTime $dateTime): Repository
$this->dateCreated = $dateTime;
return $this;
}
}
}
2 changes: 1 addition & 1 deletion src/Entity/Student.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ public function setNumero(string $numero): Student
$this->numero = $numero;
return $this;
}
}
}
2 changes: 1 addition & 1 deletion src/Exception/DateInvalideErrorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ class DateInvalideErrorException extends \Exception

// 100 Exception du fichier Ecole Directe
// 101 Exception du fichier par defaut
}
}
2 changes: 1 addition & 1 deletion src/Exception/InvalideArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
class InvalideArgumentException extends \Exception
{
protected $message = "Argument input is invalide";
}
}
2 changes: 1 addition & 1 deletion src/Exception/NoTypeErrorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ class NoTypeErrorException extends \Exception
protected $message = "Nous n'avons pas trouvé de modele";

// 300
}
}
2 changes: 1 addition & 1 deletion src/Exception/ReadInvalideErrorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ class ReadInvalideErrorException extends \Exception
protected $message = "Une erreur s'est produite lors de la lecture de votre fichier";

// 200
}
}
2 changes: 1 addition & 1 deletion src/Service/CkeckStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ private function run(): array

return $listCheck;
}
}
}
3 changes: 1 addition & 2 deletions src/Service/Command/CommandBanner.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Studoo\Service\Command;

use DateTime;
Expand Down Expand Up @@ -106,4 +105,4 @@ public static function setVersion(string $version): void
{
self::$version = $version;
}
}
}
2 changes: 1 addition & 1 deletion src/Service/Command/QuestionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ public function Choice(string $nameQuestion, array $choiseQuestion, string $mess
}


}
}
3 changes: 2 additions & 1 deletion src/Service/Config/FileLock.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ public function setRepository(string $idStudent, string $nameRepository): FileLo
{
$this->listRepository[$idStudent] = (new Repository())
->setDateCreated(new \DateTime('now'))
->setId($nameRepository
->setId(
$nameRepository
)->setName($nameRepository);

return $this;
Expand Down
4 changes: 1 addition & 3 deletions src/Service/Config/FileStudend.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
* veuillez consulter le fichier LICENSE qui a été distribué avec ce code source.
*/


namespace Studoo\Service\Config;

class FileStudend extends FileConfig
{

}
}
2 changes: 1 addition & 1 deletion src/Service/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ public function isValid(string $date, string $format = 'Y-m-d'): bool
}


}
}
2 changes: 1 addition & 1 deletion src/Service/FileModel/FileModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
class FileModel
{
protected static $arrFileModel = [];
}
}
2 changes: 1 addition & 1 deletion src/Service/FileModel/FileModelInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ public function getStudents(): array;
* @return string
*/
public function getNameModel(): string;
}
}
2 changes: 1 addition & 1 deletion src/Service/FileModel/FileModelLoadInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ interface FileModelLoadInterface
* @return array
*/
public function getListFileModel(): array;
}
}
2 changes: 1 addition & 1 deletion src/Service/FileModel/FileModelLoadXLSX.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ public function getListFileModel(): array
\Studoo\Service\FileModel\FileModelXLSXFileAcademique::class
];
}
}
}
3 changes: 1 addition & 2 deletions src/Service/FileModel/FileModelXLSXFileAcademique.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

class FileModelXLSXFileAcademique extends FileModel implements FileModelInterface
{

public function analyse(array $structure): bool
{
$state = false;
Expand Down Expand Up @@ -62,4 +61,4 @@ public function getNameModel(): string
return "Fichier XLSX Export by Academique";
}

}
}
3 changes: 1 addition & 2 deletions src/Service/FileModel/FileModelXLSXFileDefault.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

class FileModelXLSXFileDefault extends FileModel implements FileModelInterface
{

public function analyse(array $structure): bool
{
$state = false;
Expand Down Expand Up @@ -60,4 +59,4 @@ public function getNameModel(): string
{
return "Fichier XLSX par défaut";
}
}
}
3 changes: 1 addition & 2 deletions src/Service/FileModel/FileModelXLSXFileEcoleDirecte.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

class FileModelXLSXFileEcoleDirecte extends FileModel implements FileModelInterface
{

public function analyse(array $structure): bool
{
$state = false;
Expand Down Expand Up @@ -84,4 +83,4 @@ private function splitStudentName(string $fullName, Student $student): Student

return $student;
}
}
}
2 changes: 1 addition & 1 deletion src/Service/FileSystem/Dir.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ public function createDir(string $path): bool
}
}

}
}
2 changes: 1 addition & 1 deletion src/Service/FileSystem/FileExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ public static function getListExtensionByName(): array
return $listExt;
}

}
}
4 changes: 2 additions & 2 deletions src/Service/FileSystem/FileLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static function execute(): array
$FileModelLoader = 'Studoo\Service\FileModel\FileModelLoad' . FileSource::getFileExtension();
$exeFileModel = new $FileModelLoader();
foreach ($exeFileModel->getListFileModel() as $FileModel) {
$ModelClass = new $FileModel;
$ModelClass = new $FileModel();
if ($ModelClass->analyse($exeFileType->getContent()) === true) {
self::$FileModelSelect = $ModelClass;
CommandManage::getStdOutPut()->writeln($ModelClass->getNameModel());
Expand Down Expand Up @@ -56,4 +56,4 @@ public static function getModelSelected()
return self::$FileModelSelect;
}

}
}
2 changes: 1 addition & 1 deletion src/Service/FileSystem/FileSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ public function getFile($path): SplFileInfo
return $file->setFileSelected($finalChoiseFile);
}

}
}
2 changes: 1 addition & 1 deletion src/Service/FileSystem/FileSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ public static function getFileExtension(): string
}


}
}
2 changes: 1 addition & 1 deletion src/Service/FileSystem/FinderType.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@ public function getListFilename(): array
}


}
}
2 changes: 1 addition & 1 deletion src/Service/FileType/FileTypeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ interface FileTypeInterface
*/
public function getContent(): array;

}
}
2 changes: 1 addition & 1 deletion src/Service/FileType/FileTypeXLSX.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ public function getContent(): array
printf("%s (%s) ERR%u \n", $exception->getMessage(), SimpleXLSX::parseError(), "200");
}
}
}
}
2 changes: 1 addition & 1 deletion src/Service/NomanclatureService.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ public function getDateToString(\DateTime $dateTime): string
return $dateTime->format('ymd');
}

}
}
3 changes: 1 addition & 2 deletions src/Service/StandardRaw.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Studoo\Service;

/**
Expand Down Expand Up @@ -88,4 +87,4 @@ private function cleanBeginToEndWhiteSpace(string $raw): ?string
return rtrim(ltrim($raw));
}

}
}
2 changes: 1 addition & 1 deletion src/Service/listCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ public function render()
'',
]);
}
}
}

0 comments on commit 19c5012

Please sign in to comment.