Skip to content

Commit

Permalink
Several phpdoc fixes (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeZery authored and jessmchung committed Aug 18, 2017
1 parent 16e88ae commit 8a2c927
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 27 deletions.
12 changes: 6 additions & 6 deletions src/Cascade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
*/
namespace Cascade;

use Monolog\Handler\HandlerInterface;
use Monolog\Logger;
use Monolog\Registry;

use Cascade\Config;
use Cascade\Config\ConfigLoader;

/**
* Module class that manages Monolog Logger object
* @see Monolog\Logger
* @see Monolog\Registry
* @see Logger
* @see Registry
*
* @author Raphael Antonmattei <[email protected]>
*/
Expand All @@ -34,12 +34,12 @@ class Cascade

/**
* Create a new Logger object and push it to the registry
* @see Monolog\Logger::__construct
* @see Logger::__construct
*
* @throws \InvalidArgumentException if no name is given
*
* @param string $name The logging channel
* @param Monolog\Handler\HandlerInterface[] $handlers Optional stack of handlers, the first
* @param HandlerInterface[] $handlers Optional stack of handlers, the first
* one in the array is called first, etc.
* @param callable[] $processors Optional array of processors
*
Expand Down Expand Up @@ -90,7 +90,7 @@ public static function logger($name)
/**
* Return the config options
*
* @return array Array with configuration options
* @return Config Array with configuration options
*/
public static function getConfig()
{
Expand Down
4 changes: 2 additions & 2 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
namespace Cascade;

use Monolog\Registry;
use Monolog;

use Cascade\Config\ConfigLoader;
use Cascade\Config\Loader\ClassLoader\FormatterLoader;
Expand Down Expand Up @@ -99,7 +99,7 @@ public function configure()
}

if ($this->options['disable_existing_loggers']) {
Registry::clear();
Monolog\Registry::clear();
}

if (isset($this->options['formatters'])) {
Expand Down
4 changes: 2 additions & 2 deletions src/Config/Loader/ClassLoader/FormatterLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
namespace Cascade\Config\Loader\ClassLoader;

use Monolog\Formatter\LineFormatter;
use Monolog;

use Cascade\Config\Loader\ClassLoader;

Expand Down Expand Up @@ -63,7 +63,7 @@ public static function initExtraOptionsHandlers()
{
self::$extraOptionHandlers = array(
'Monolog\Formatter\LineFormatter' => array(
'includeStacktraces' => function (LineFormatter $instance, $include) {
'includeStacktraces' => function (Monolog\Formatter\LineFormatter $instance, $include) {
$instance->includeStacktraces($include);
}
)
Expand Down
2 changes: 1 addition & 1 deletion src/Config/Loader/ClassLoader/HandlerLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class HandlerLoader extends ClassLoader
/**
* Constructor
* @see ClassLoader::__construct
* @see Monolog\Handler classes for handler options
* @see \Monolog\Handler classes for handler options
*
* @param array $handlerOptions Handler options
* @param FormatterInterface[] $formatters Array of formatter to pick from
Expand Down
3 changes: 2 additions & 1 deletion src/Config/Loader/ClassLoader/LoggerLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
namespace Cascade\Config\Loader\ClassLoader;

use Cascade\Cascade;
use Cascade\Config\Loader\ClassLoader;

use Monolog;

/**
* Logger Loader. Instantiate a Logger and set passed in handlers and processors if any
Expand Down
2 changes: 2 additions & 0 deletions src/Config/Loader/ClassLoader/ProcessorLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

use Cascade\Config\Loader\ClassLoader;

use Monolog;

/**
* Processor Loader. Loads the Processor options, validate them and instantiates
* a Processor object (implementing Monolog\Processor\ProcessorInterface) with all
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static function generateParamsHashKey($params)
/**
* Configure options for the provided OptionResolver to match extra params requirements
*
* @param OptionsResolver $optionsResolver OptionResolver to configure
* @param OptionsResolver $resolver OptionResolver to configure
* @param ClassLoader|null $classLoader Optional class loader if you want to use custom
* handlers for some of the extra options
*/
Expand Down
5 changes: 2 additions & 3 deletions tests/CascadeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Monolog\Registry;

use Cascade\Cascade;
use Cascade\Tests\Fixtures;

/**
* Class CascadeTest
Expand Down Expand Up @@ -49,11 +48,11 @@ public function testRegistry()
}

/**
* @expectedException InvalidArgumentException
* @expectedException \InvalidArgumentException
*/
public function testRegistryWithInvalidName()
{
$logger = Cascade::getLogger(null);
Cascade::getLogger(null);
}

public function testFileConfig()
Expand Down
2 changes: 1 addition & 1 deletion tests/Config/Loader/ClassLoader/FormatterLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public function tearDown()
*
* @param string $class Class name the handler applies to
* @param string $optionName Option name
*
* @return \Closure Closure
* @throws \Exception
*/
private function getHandler($class, $optionName)
{
Expand Down
10 changes: 5 additions & 5 deletions tests/Config/Loader/ClassLoader/HandlerLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function testHandlerLoaderWithNoOptions()
}

/**
* @expectedException InvalidArgumentException
* @expectedException \InvalidArgumentException
*/
public function testHandlerLoaderWithInvalidFormatter()
{
Expand All @@ -67,7 +67,7 @@ public function testHandlerLoaderWithInvalidFormatter()
}

/**
* @expectedException InvalidArgumentException
* @expectedException \InvalidArgumentException
*/
public function testHandlerLoaderWithInvalidProcessor()
{
Expand All @@ -84,7 +84,7 @@ public function testHandlerLoaderWithInvalidProcessor()
}

/**
* @expectedException InvalidArgumentException
* @expectedException \InvalidArgumentException
*/
public function testHandlerLoaderWithInvalidHandler()
{
Expand All @@ -102,7 +102,7 @@ public function testHandlerLoaderWithInvalidHandler()
}

/**
* @expectedException InvalidArgumentException
* @expectedException \InvalidArgumentException
*/
public function testHandlerLoaderWithInvalidHandlers()
{
Expand All @@ -128,8 +128,8 @@ public function testHandlerLoaderWithInvalidHandlers()
*
* @param string $class Class name the handler applies to
* @param string $optionName Option name
*
* @return \Closure Closure
* @throws \Exception
*/
private function getHandler($class, $optionName)
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Config/Loader/ClassLoader/LoggerLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function testResolveHandlers()
}

/**
* @expectedException InvalidArgumentException
* @expectedException \InvalidArgumentException
*/
public function testResolveHandlersWithMismatch()
{
Expand Down Expand Up @@ -96,7 +96,7 @@ public function testResolveProcessors()
}

/**
* @expectedException InvalidArgumentException
* @expectedException \InvalidArgumentException
*/
public function testResolveProcessorsWithMismatch()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
use Cascade\Util;
use Cascade\Config\Loader\ClassLoader\Resolver\ConstructorResolver;

use Symfony;

/**
* Class ConstructorResolverTest
*
Expand Down Expand Up @@ -55,7 +57,7 @@ public function tearDown()
/**
* Return the contructor args of the reflected class
*
* @return ReflectionParameter[] array of params
* @return \ReflectionParameter[] array of params
*/
protected function getConstructorArgs()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

use Cascade\Config\Loader\ClassLoader\Resolver\ExtraOptionsResolver;

use Symfony;

/**
* Class ExtraOptionsResolverTest
*
Expand Down
4 changes: 2 additions & 2 deletions tests/Config/Loader/FileLoader/FileLoaderAbstractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function extensionsDataProvider()
* Test validating the extension
*
* @param boolean $expected Expected boolean value
* @param string filepath Filepath to validate
* @param string $filepath Filepath to validate
* @dataProvider extensionsDataProvider
*/
public function testValidateExtension($expected, $filepath)
Expand Down Expand Up @@ -152,7 +152,7 @@ public function testGetSectionOf(array $array, $section, array $expected)
/**
* Test loading an invalid file
*
* @expectedException RuntimeException
* @expectedException \RuntimeException
*/
public function testloadFileFromInvalidFile()
{
Expand Down
1 change: 1 addition & 0 deletions tests/Fixtures/SampleClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class SampleClass
* @param mixed $mandatory Some mandatory param
* @param string $optionalA Some optional param
* @param string $optionalB Some other optional param
* @param string $optional_snake Some optional snake param
*/
public function __construct(
$mandatory,
Expand Down

0 comments on commit 8a2c927

Please sign in to comment.