Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
[ci skip] [skip ci]
  • Loading branch information
Jeroen-G authored and StyleCIBot committed Oct 10, 2021
1 parent 2c9a778 commit f7a01a0
Show file tree
Hide file tree
Showing 16 changed files with 65 additions and 48 deletions.
5 changes: 2 additions & 3 deletions src/ArchiveExtractors/Extractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
abstract class Extractor
{
/**
* @param string $pathToArchive
* @param string $pathToDirectory
*
* @param string $pathToArchive
* @param string $pathToDirectory
* @return void
*/
abstract public function extract(string $pathToArchive, string $pathToDirectory): void;
Expand Down
9 changes: 4 additions & 5 deletions src/ArchiveExtractors/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public function __construct()
}

/**
* @param string $archiveExtension
*
* @param string $archiveExtension
* @return Extractor
*
* @throws InvalidArgumentException
*/
public function getExtractor(string $archiveExtension): Extractor
Expand All @@ -35,9 +35,8 @@ public function getExtractor(string $archiveExtension): Extractor
}

/**
* @param string $archiveExtension
* @param Extractor $instance
*
* @param string $archiveExtension
* @param Extractor $instance
* @return self
*/
public function addExtractor(string $archiveExtension, Extractor $instance): self
Expand Down
2 changes: 1 addition & 1 deletion src/ArchiveExtractors/TarGz.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function extract(string $pathToArchive, string $pathToDirectory): void
/**
* Get the path to the tar within the gz folder.
*
* @param string $pathToArchive
* @param string $pathToArchive
* @return string
*/
private function extractTarPathFromGz(string $pathToArchive): string
Expand Down
2 changes: 2 additions & 0 deletions src/Commands/CheckPackage.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ class CheckPackage extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'packager:check {vendor} {name}';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Check the composer.lock for security vulnerabilities.';
Expand Down
4 changes: 4 additions & 0 deletions src/Commands/GetPackage.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class GetPackage extends Command

/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'packager:get
Expand All @@ -29,18 +30,21 @@ class GetPackage extends Command

/**
* The console command description.
*
* @var string
*/
protected $description = 'Retrieve an existing package from Github or Bitbucket.';

/**
* Packages roll off of the conveyor.
*
* @var object \JeroenG\Packager\Conveyor
*/
protected $conveyor;

/**
* Packages are packed in wrappings to personalise them.
*
* @var object \JeroenG\Packager\Wrapping
*/
protected $wrapping;
Expand Down
4 changes: 4 additions & 0 deletions src/Commands/GitPackage.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class GitPackage extends Command

/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'packager:git
Expand All @@ -28,18 +29,21 @@ class GitPackage extends Command

/**
* The console command description.
*
* @var string
*/
protected $description = 'Retrieve an existing package with git.';

/**
* Packages roll off of the conveyor.
*
* @var object \JeroenG\Packager\Conveyor
*/
protected $conveyor;

/**
* Packages are packed in wrappings to personalise them.
*
* @var object \JeroenG\Packager\Wrapping
*/
protected $wrapping;
Expand Down
11 changes: 5 additions & 6 deletions src/Commands/ListPackages.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ class ListPackages extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'packager:list
{--g|git : Show Git branch status}';

/**
* The console command description.
*
* @var string
*/
protected $description = 'List all locally installed packages.';
Expand Down Expand Up @@ -67,7 +69,7 @@ private function getPackagesList(): array
/**
* Render the list as a simple table.
*
* @param array $packages
* @param array $packages
*/
private function renderBasicTable(array $packages): void
{
Expand Down Expand Up @@ -95,8 +97,7 @@ private function renderGitTable($packages): void
/**
* If a package has a git history, add its status.
*
* @param string $path
*
* @param string $path
* @return array
*/
private function getGitStatus(string $path): array
Expand All @@ -118,8 +119,7 @@ private function getGitStatus(string $path): array
* It returns the difference in commits as a positive or negative integer.
* A positive number means the local package is behind. Otherwise it is ahead.
*
* @param string $path
*
* @param string $path
* @return int
*/
private function getCommitDifference(string $path): int
Expand All @@ -138,7 +138,6 @@ private function getCommitDifference(string $path): int
* Gets the branch name for a package.
*
* @param $path
*
* @return string|null
*/
private function getCurrentBranchForPackage($path): ?string
Expand Down
4 changes: 4 additions & 0 deletions src/Commands/NewPackage.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,28 @@ class NewPackage extends Command

/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'packager:new {vendor?} {name?} {--i} {--skeleton=}';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Create a new package.';

/**
* Packages roll off of the conveyor.
*
* @var object \JeroenG\Packager\Conveyor
*/
protected $conveyor;

/**
* Packages are packed in wrappings to personalise them.
*
* @var object \JeroenG\Packager\Wrapping
*/
protected $wrapping;
Expand Down
3 changes: 3 additions & 0 deletions src/Commands/PublishPackage.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class PublishPackage extends Command

/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'packager:publish
Expand All @@ -26,12 +27,14 @@ class PublishPackage extends Command

/**
* The console command description.
*
* @var string
*/
protected $description = 'Publish your package to Github with git.';

/**
* Packages roll off of the conveyor.
*
* @var object \JeroenG\Packager\Conveyor
*/
protected $conveyor;
Expand Down
4 changes: 4 additions & 0 deletions src/Commands/RemovePackage.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,28 @@ class RemovePackage extends Command

/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'packager:remove {vendor} {name?}';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Remove an existing package.';

/**
* Packages roll off of the conveyor.
*
* @var object \JeroenG\Packager\Conveyor
*/
protected $conveyor;

/**
* Packages are packed in wrappings to personalise them.
*
* @var object \JeroenG\Packager\Wrapping
*/
protected $wrapping;
Expand Down
10 changes: 4 additions & 6 deletions src/Conveyor.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ class Conveyor
/**
* Set or get the package vendor namespace.
*
* @param string $vendor
*
* @param string $vendor
* @return string|RuntimeException
*/
public function vendor($vendor = null)
Expand Down Expand Up @@ -65,8 +64,7 @@ public function vendorKebab()
/**
* Set or get the package name.
*
* @param string $package
*
* @param string $package
* @return string|RuntimeException
*/
public function package($package = null)
Expand Down Expand Up @@ -125,8 +123,8 @@ public function downloadSkeleton($skeletonArchiveUrl = null)
/**
* Download the package from Github.
*
* @param string $origin The Github URL
* @param string $branch The branch to download
* @param string $origin The Github URL
* @param string $branch The branch to download
*/
public function downloadFromGithub($origin, $piece, $branch)
{
Expand Down
18 changes: 8 additions & 10 deletions src/FileHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ public function packagePath()
/**
* Generate a random temporary filename for the package archive file.
*
* @param string $extension
*
* @param string $extension
* @return string
*/
public function makeFilename($extension = 'zip')
Expand All @@ -65,7 +64,7 @@ public function makeFilename($extension = 'zip')
/**
* Check if the package already exists.
*
* @return void Throws error if package exists, aborts process
* @return void Throws error if package exists, aborts process
*/
public function checkIfPackageExists()
{
Expand All @@ -77,7 +76,7 @@ public function checkIfPackageExists()
/**
* Create a directory if it doesn't exist.
*
* @param string $path Path of the directory to make
* @param string $path Path of the directory to make
* @return bool
*/
public function makeDir($path)
Expand All @@ -92,7 +91,7 @@ public function makeDir($path)
/**
* Remove a directory if it exists.
*
* @param string $path Path of the directory to remove.
* @param string $path Path of the directory to remove.
* @return bool
*/
public function removeDir($path)
Expand Down Expand Up @@ -133,8 +132,8 @@ public function download($filePath, $sourceFileUrl)
/**
* Extract the downloaded archive into the given directory.
*
* @param string $archiveFilePath
* @param string $directory
* @param string $archiveFilePath
* @param string $directory
* @return $this
*/
public function extract($archiveFilePath, $directory)
Expand Down Expand Up @@ -164,7 +163,7 @@ public function cleanUp($pathToArchive)
/**
* Rename generic files to package-specific ones.
*
* @param array|null $manifest
* @param array|null $manifest
* @return void
**/
public function renameFiles($manifest = null)
Expand Down Expand Up @@ -204,8 +203,7 @@ public function cleanUpRules()
/**
* Based on the extension a different archive extractor is used.
*
* @param string $archiveFilePath
*
* @param string $archiveFilePath
* @return string
*/
protected function getArchiveExtension($archiveFilePath): string
Expand Down
1 change: 1 addition & 0 deletions src/PackagerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class PackagerServiceProvider extends ServiceProvider

/**
* Bootstrap the application events.
*
* @throws BindingResolutionException
*/
public function boot()
Expand Down
5 changes: 3 additions & 2 deletions src/ProgressBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ trait ProgressBar
{
/**
* Symfony ProgressBar instance.
*
* @var object \Symfony\Component\Console\Helper\ProgressBar
*/
protected $bar;

/**
* Setting custom formatting for the progress bar.
*
* @param int $steps The number of steps the progress bar has.
* @param int $steps The number of steps the progress bar has.
* @return void
*/
public function startProgressBar($steps)
Expand Down Expand Up @@ -50,7 +51,7 @@ public function makeProgress()
/**
* Finalise the progress, output the (last) message.
*
* @param string $message
* @param string $message
* @return void
*/
public function finishProgress($message)
Expand Down
Loading

0 comments on commit f7a01a0

Please sign in to comment.