for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of laravel-quota
*
* (c) David Faith <[email protected]>
* Full copyright and license information is available
* in the LICENSE file distributed with this source code.
*/
namespace Projectmentor\Quota\Stubs;
use Projectmentor\Quota\Contracts\PayloadInterface;
use Projectmentor\Quota\Contracts\FactoryInterface;
* This is the filestorage data class.
* It stubs constructor parameters for:
* bandwithThottle\tokenBucket\storage\FileStorage
* Initial properties for a new FileStorage instance via
* \Projectmentor\Quota\Factories\FactoryInterface
* @author David Faith <[email protected]>
class FileStorageData implements PayloadInterface
{
* The path to persistant storage
* @var string
protected $path;
* Initialize $this
* @param string $path to persistant storage
* @return void
@return
Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.
Please refer to the PHP core documentation on constructors.
public function __construct($path)
//TODO: validate
$this->path = $path;
}
* Get the path attribute.
* @return string
public function getPath()
return $this->path;
* Implements PayloadInterface
* emit json payload.
public function toJson()
return 'Hi';
* emit array payload.
string[]
This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.
public function toArray()
return ['Hi'];
This check marks files that end in a newline character, i.e. an empy line.
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.