Skip to content

Commit

Permalink
CS Fixes - Replaced "array of type" by "Type[]" in PHPDoc block
Browse files Browse the repository at this point in the history
  • Loading branch information
raziel057 authored and fabpot committed Nov 19, 2012
1 parent f449fbd commit 960445b
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 83 deletions.
65 changes: 18 additions & 47 deletions Kernel.php
Expand Up @@ -46,7 +46,11 @@
*/
abstract class Kernel implements KernelInterface, TerminableInterface
{
/**
* @var BundleInterface[]
*/
protected $bundles;

protected $bundleMap;
protected $container;
protected $rootDir;
Expand Down Expand Up @@ -157,9 +161,7 @@ public function terminate(Request $request, Response $response)
}

/**
* Shutdowns the kernel.
*
* This method is mainly useful when doing functional testing.
* {@inheritdoc}
*
* @api
*/
Expand Down Expand Up @@ -204,10 +206,8 @@ protected function getHttpKernel()
}

/**
* Gets the registered bundle instances.
*
* @return array An array of registered bundle instances
*
* {@inheritdoc}
*
* @api
*/
public function getBundles()
Expand All @@ -216,11 +216,7 @@ public function getBundles()
}

/**
* Checks if a given class name belongs to an active bundle.
*
* @param string $class A class name
*
* @return Boolean true if the class belongs to an active bundle, false otherwise
* {@inheritdoc}
*
* @api
*/
Expand All @@ -236,14 +232,7 @@ public function isClassInActiveBundle($class)
}

/**
* Returns a bundle and optionally its descendants by its name.
*
* @param string $name Bundle name
* @param Boolean $first Whether to return the first bundle only or together with its descendants
*
* @return BundleInterface|Array A BundleInterface instance or an array of BundleInterface instances if $first is false
*
* @throws \InvalidArgumentException when the bundle is not enabled
* {@inheritdoc}
*
* @api
*/
Expand Down Expand Up @@ -346,9 +335,7 @@ public function locateResource($name, $dir = null, $first = true)
}

/**
* Gets the name of the kernel
*
* @return string The kernel name
* {@inheritdoc}
*
* @api
*/
Expand All @@ -362,9 +349,7 @@ public function getName()
}

/**
* Gets the environment.
*
* @return string The current environment
* {@inheritdoc}
*
* @api
*/
Expand All @@ -374,9 +359,7 @@ public function getEnvironment()
}

/**
* Checks if debug mode is enabled.
*
* @return Boolean true if debug mode is enabled, false otherwise
* {@inheritdoc}
*
* @api
*/
Expand All @@ -386,9 +369,7 @@ public function isDebug()
}

/**
* Gets the application root dir.
*
* @return string The application root dir
* {@inheritdoc}
*
* @api
*/
Expand All @@ -403,9 +384,7 @@ public function getRootDir()
}

/**
* Gets the current container.
*
* @return ContainerInterface A ContainerInterface instance
* {@inheritdoc}
*
* @api
*/
Expand Down Expand Up @@ -436,9 +415,7 @@ public function setClassCache(array $classes)
}

/**
* Gets the request start time (not available if debug is disabled).
*
* @return integer The request start timestamp
* {@inheritdoc}
*
* @api
*/
Expand All @@ -448,9 +425,7 @@ public function getStartTime()
}

/**
* Gets the cache directory.
*
* @return string The cache directory
* {@inheritdoc}
*
* @api
*/
Expand All @@ -460,9 +435,7 @@ public function getCacheDir()
}

/**
* Gets the log directory.
*
* @return string The log directory
* {@inheritdoc}
*
* @api
*/
Expand All @@ -472,9 +445,7 @@ public function getLogDir()
}

/**
* Gets the charset of the application.
*
* @return string The charset
* {@inheritdoc}
*
* @api
*/
Expand Down
6 changes: 3 additions & 3 deletions KernelInterface.php
Expand Up @@ -30,7 +30,7 @@ interface KernelInterface extends HttpKernelInterface, \Serializable
/**
* Returns an array of bundles to registers.
*
* @return array An array of bundle instances.
* @return BundleInterface[] An array of bundle instances.
*
* @api
*/
Expand Down Expand Up @@ -64,7 +64,7 @@ public function shutdown();
/**
* Gets the registered bundle instances.
*
* @return array An array of registered bundle instances
* @return BundleInterface[] An array of registered bundle instances
*
* @api
*/
Expand All @@ -87,7 +87,7 @@ public function isClassInActiveBundle($class);
* @param string $name Bundle name
* @param Boolean $first Whether to return the first bundle only or together with its descendants
*
* @return BundleInterface|Array A BundleInterface instance or an array of BundleInterface instances if $first is false
* @return BundleInterface|BundleInterface[] A BundleInterface instance or an array of BundleInterface instances if $first is false
*
* @throws \InvalidArgumentException when the bundle is not enabled
*
Expand Down
32 changes: 10 additions & 22 deletions Profiler/MongoDbProfilerStorage.php
Expand Up @@ -32,14 +32,7 @@ public function __construct($dsn, $username = '', $password = '', $lifetime = 86
}

/**
* Finds profiler tokens for the given criteria.
*
* @param string $ip The IP
* @param string $url The URL
* @param string $limit The maximum number of tokens to return
* @param string $method The request method
*
* @return array An array of tokens
* {@inheritdoc}
*/
public function find($ip, $url, $limit, $method)
{
Expand All @@ -54,21 +47,15 @@ public function find($ip, $url, $limit, $method)
}

/**
* Purges all data from the database.
* {@inheritdoc}
*/
public function purge()
{
$this->getMongo()->remove(array());
}

/**
* Reads data associated with the given token.
*
* The method returns false if the token does not exists in the storage.
*
* @param string $token A token
*
* @return Profile The profile associated with token
* {@inheritdoc}
*/
public function read($token)
{
Expand All @@ -82,11 +69,7 @@ public function read($token)
}

/**
* Saves a Profile.
*
* @param Profile $profile A Profile instance
*
* @return Boolean Write operation successful
* {@inheritdoc}
*/
public function write(Profile $profile)
{
Expand Down Expand Up @@ -128,6 +111,7 @@ protected function getMongo()

/**
* @param array $data
*
* @return Profile
*/
protected function createProfileFromData(array $data)
Expand All @@ -148,7 +132,8 @@ protected function createProfileFromData(array $data)

/**
* @param string $token
* @return array
*
* @return Profile[] An array of Profile instances
*/
protected function readChildren($token)
{
Expand All @@ -171,6 +156,7 @@ protected function cleanup()
* @param string $ip
* @param string $url
* @param string $method
*
* @return array
*/
private function buildQuery($ip, $url, $method)
Expand All @@ -194,6 +180,7 @@ private function buildQuery($ip, $url, $method)

/**
* @param array $data
*
* @return array
*/
private function getData(array $data)
Expand All @@ -211,6 +198,7 @@ private function getData(array $data)

/**
* @param array $data
*
* @return Profile
*/
private function getProfile(array $data)
Expand Down
2 changes: 1 addition & 1 deletion Profiler/PdoProfilerStorage.php
Expand Up @@ -216,7 +216,7 @@ protected function createProfileFromData($token, $data, $parent = null)
* @param string $token The parent token
* @param string $parent The parent instance
*
* @return array An array of Profile instance
* @return Profile[] An array of Profile instance
*/
protected function readChildren($token, $parent)
{
Expand Down

0 comments on commit 960445b

Please sign in to comment.