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 BlockingConsumer data class.
* It stubs constructor parameters for:
* bandwithThottle\tokenBucket\BlockingConsumer
* Initial properties for a new BlockingConsumer instance via
* \Projectmentor\Quota\Factories\FactoryInterface
* @author David Faith <[email protected]>
class BlockingConsumerData implements PayloadInterface
{
* The TokenBucket.
* @var bandwithThottle\tokenBucket\TokenBucket
protected $bucket;
* Initialize $this
* @param bandwithThottle\tokenBucket\TokenBucket
* @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($bucket)
$this->bucket = $bucket;
}
* Get the bucket instance.
* @return bandwithThottle\tokenBucket\TokenBucket
public function getBucket()
return $this->bucket;
* Implements PayloadInterface
* emit json payload.
* @return string
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.