Skip to content

Commit

Permalink
allow code highligthing in generated api
Browse files Browse the repository at this point in the history
  • Loading branch information
antograssiot committed Apr 19, 2015
1 parent 3e036c8 commit eea4bcb
Show file tree
Hide file tree
Showing 36 changed files with 460 additions and 154 deletions.
4 changes: 3 additions & 1 deletion src/Auth/DigestAuthenticate.php
Expand Up @@ -51,7 +51,9 @@
* DigestAuthenticate requires a special password hash that conforms to RFC2617.
* You can generate this password using `DigestAuthenticate::password()`
*
* `$digestPass = DigestAuthenticate::password($username, $password, env('SERVER_NAME'));`
* ```
* $digestPass = DigestAuthenticate::password($username, $password, env('SERVER_NAME'));
* ```
*
* If you wish to use digest authentication alongside other authentication methods,
* it's recommended that you store the digest authentication separately. For
Expand Down
48 changes: 36 additions & 12 deletions src/Cache/Cache.php
Expand Up @@ -188,11 +188,15 @@ public static function gc($config = 'default', $expires = null)
*
* Writing to the active cache config:
*
* `Cache::write('cached_data', $data);`
* ```
* Cache::write('cached_data', $data);
* ```
*
* Writing to a specific cache config:
*
* `Cache::write('cached_data', $data, 'long_term');`
* ```
* Cache::write('cached_data', $data, 'long_term');
* ```
*
* @param string $key Identifier for the data
* @param mixed $value Data to be cached - anything except a resource
Expand Down Expand Up @@ -228,11 +232,15 @@ public static function write($key, $value, $config = 'default')
*
* Writing to the active cache config:
*
* `Cache::writeMany(['cached_data_1' => 'data 1', 'cached_data_2' => 'data 2']);`
* ```
* Cache::writeMany(['cached_data_1' => 'data 1', 'cached_data_2' => 'data 2']);
* ```
*
* Writing to a specific cache config:
*
* `Cache::writeMany(['cached_data_1' => 'data 1', 'cached_data_2' => 'data 2'], 'long_term');`
* ```
* Cache::writeMany(['cached_data_1' => 'data 1', 'cached_data_2' => 'data 2'], 'long_term');
* ```
*
* @param array $data An array of data to be stored in the cache
* @param string $config Optional string configuration name to write to. Defaults to 'default'
Expand Down Expand Up @@ -263,11 +271,15 @@ public static function writeMany($data, $config = 'default')
*
* Reading from the active cache configuration.
*
* `Cache::read('my_data');`
* ```
* Cache::read('my_data');
* ```
*
* Reading from a specific cache configuration.
*
* `Cache::read('my_data', 'long_term');`
* ```
* Cache::read('my_data', 'long_term');
* ```
*
* @param string $key Identifier for the data
* @param string $config optional name of the configuration to use. Defaults to 'default'
Expand All @@ -286,11 +298,15 @@ public static function read($key, $config = 'default')
*
* Reading multiple keys from the active cache configuration.
*
* `Cache::readMany(['my_data_1', 'my_data_2]);`
* ```
* Cache::readMany(['my_data_1', 'my_data_2]);
* ```
*
* Reading from a specific cache configuration.
*
* `Cache::readMany(['my_data_1', 'my_data_2], 'long_term');`
* ```
* Cache::readMany(['my_data_1', 'my_data_2], 'long_term');
* ```
*
* @param array $keys an array of keys to fetch from the cache
* @param string $config optional name of the configuration to use. Defaults to 'default'
Expand Down Expand Up @@ -348,11 +364,15 @@ public static function decrement($key, $offset = 1, $config = 'default')
*
* Deleting from the active cache configuration.
*
* `Cache::delete('my_data');`
* ```
* Cache::delete('my_data');
* ```
*
* Deleting from a specific cache configuration.
*
* `Cache::delete('my_data', 'long_term');`
* ```
* Cache::delete('my_data', 'long_term');
* ```
*
* @param string $key Identifier for the data
* @param string $config name of the configuration to use. Defaults to 'default'
Expand All @@ -371,11 +391,15 @@ public static function delete($key, $config = 'default')
*
* Deleting multiple keys from the active cache configuration.
*
* `Cache::deleteMany(['my_data_1', 'my_data_2']);`
* ```
* Cache::deleteMany(['my_data_1', 'my_data_2']);
* ```
*
* Deleting from a specific cache configuration.
*
* `Cache::deleteMany(['my_data_1', 'my_data_2], 'long_term');`
* ```
* Cache::deleteMany(['my_data_1', 'my_data_2], 'long_term');
* ```
*
* @param array $keys Array of cache keys to be deleted
* @param string $config name of the configuration to use. Defaults to 'default'
Expand Down
4 changes: 3 additions & 1 deletion src/Console/ConsoleOptionParser.php
Expand Up @@ -60,7 +60,9 @@
* arguments any arguments greater than those defined will cause exceptions. Additionally you can
* declare arguments as optional, by setting the required param to false.
*
* `$parser->addArgument('model', ['required' => false]);`
* ```
* $parser->addArgument('model', ['required' => false]);
* ```
*
* ### Providing Help text
*
Expand Down
20 changes: 15 additions & 5 deletions src/Console/ConsoleOutput.php
Expand Up @@ -33,7 +33,9 @@
*
* You can format console output using tags with the name of the style to apply. From inside a shell object
*
* `$this->out('<warning>Overwrite:</warning> foo.php was overwritten.');`
* ```
* $this->out('<warning>Overwrite:</warning> foo.php was overwritten.');
* ```
*
* This would create orange 'Overwrite:' text, while the rest of the text would remain the normal color.
* See ConsoleOutput::styles() to learn more about defining your own styles. Nested styles are not supported
Expand Down Expand Up @@ -251,19 +253,27 @@ protected function _write($message)
*
* ### Get a style definition
*
* `$output->styles('error');`
* ```
* $output->styles('error');
* ```
*
* ### Get all the style definitions
*
* `$output->styles();`
* ```
* $output->styles();
* ```
*
* ### Create or modify an existing style
*
* `$output->styles('annoy', ['text' => 'purple', 'background' => 'yellow', 'blink' => true]);`
* ```
* $output->styles('annoy', ['text' => 'purple', 'background' => 'yellow', 'blink' => true]);
* ```
*
* ### Remove a style
*
* `$this->output->styles('annoy', false);`
* ```
* $this->output->styles('annoy', false);
* ```
*
* @param string|null $style The style to get or create.
* @param array|bool|null $definition The array definition of the style to change or create a style
Expand Down
8 changes: 6 additions & 2 deletions src/Console/Shell.php
Expand Up @@ -287,15 +287,19 @@ public function hasMethod($name)
*
* With a string command:
*
* `return $this->dispatchShell('schema create DbAcl');`
* ```
* return $this->dispatchShell('schema create DbAcl');
* ```
*
* Avoid using this form if you have string arguments, with spaces in them.
* The dispatched will be invoked incorrectly. Only use this form for simple
* command dispatching.
*
* With an array command:
*
* `return $this->dispatchShell('schema', 'create', 'i18n', '--dry');`
* ```
* return $this->dispatchShell('schema', 'create', 'i18n', '--dry');
* ```
*
* @return mixed The return of the other shell.
* @link http://book.cakephp.org/3.0/en/console-and-shells.html#invoking-other-shells-from-your-shell
Expand Down
8 changes: 6 additions & 2 deletions src/Console/ShellDispatcher.php
Expand Up @@ -80,11 +80,15 @@ public function __construct($args = [], $bootstrap = true)
*
* Aliasing a shell named ClassName:
*
* `$this->alias('alias', 'ClassName');`
* ```
* $this->alias('alias', 'ClassName');
* ```
*
* Getting the original name for a given alias:
*
* `$this->alias('alias');`
* ```
* $this->alias('alias');
* ```
*
* @param string $short The new short name for the shell.
* @param string|null $original The original full name for the shell.
Expand Down
23 changes: 17 additions & 6 deletions src/Controller/Component/AuthComponent.php
Expand Up @@ -537,9 +537,14 @@ public function getAuthorize($alias)
*
* You can use allow with either an array or a simple string.
*
* `$this->Auth->allow('view');`
* `$this->Auth->allow(['edit', 'add']);`
* `$this->Auth->allow();` to allow all actions
* ```
* $this->Auth->allow('view');
* $this->Auth->allow(['edit', 'add']);
* ```
* or to allow all actions
* ```
* $this->Auth->allow();
* ```
*
* @param string|array $actions Controller action name or array of actions
* @return void
Expand All @@ -560,9 +565,15 @@ public function allow($actions = null)
*
* You can use deny with either an array or a simple string.
*
* `$this->Auth->deny('view');`
* `$this->Auth->deny(['edit', 'add']);`
* `$this->Auth->deny();` to remove all items from the allowed list
* ```
* $this->Auth->deny('view');
* $this->Auth->deny(['edit', 'add']);
* ```
* or
* ```
* $this->Auth->deny();
* ```
* to remove all items from the allowed list
*
* @param string|array $actions Controller action name or array of actions
* @return void
Expand Down
16 changes: 12 additions & 4 deletions src/Controller/Component/RequestHandlerComponent.php
Expand Up @@ -381,11 +381,15 @@ public function isWap()
*
* Usage:
*
* `$this->RequestHandler->accepts(['xml', 'html', 'json']);`
* ```
* $this->RequestHandler->accepts(['xml', 'html', 'json']);
* ```
*
* Returns true if the client accepts any of the supplied types.
*
* `$this->RequestHandler->accepts('xml');`
* ```
* $this->RequestHandler->accepts('xml');
* ```
*
* Returns true if the client accepts xml.
*
Expand Down Expand Up @@ -518,11 +522,15 @@ public function prefers($type = null)
*
* Render the response as an 'ajax' response.
*
* `$this->RequestHandler->renderAs($this, 'ajax');`
* ```
* $this->RequestHandler->renderAs($this, 'ajax');
* ```
*
* Render the response as an xml file and force the result as a file download.
*
* `$this->RequestHandler->renderAs($this, 'xml', ['attachment' => 'myfile.xml'];`
* ```
* $this->RequestHandler->renderAs($this, 'xml', ['attachment' => 'myfile.xml'];
* ```
*
* @param Controller $controller A reference to a controller object
* @param string $type Type of response to send (e.g: 'ajax')
Expand Down
14 changes: 11 additions & 3 deletions src/Controller/Controller.php
Expand Up @@ -103,7 +103,10 @@ class Controller implements EventListenerInterface
* An array containing the names of helpers this controller uses. The array elements should
* not contain the "Helper" part of the class name.
*
* Example: `public $helpers = ['Form', 'Html', 'Time'];`
* Example:
* ```
* public $helpers = ['Form', 'Html', 'Time'];
* ```
*
* @var mixed
* @link http://book.cakephp.org/3.0/en/controllers.html#configuring-helpers-to-load
Expand Down Expand Up @@ -165,7 +168,10 @@ class Controller implements EventListenerInterface
* Array containing the names of components this controller uses. Component names
* should not contain the "Component" portion of the class name.
*
* Example: `public $components = ['RequestHandler', 'Acl'];`
* Example:
* ```
* public $components = ['RequestHandler', 'Acl'];
* ```
*
* @var array
* @link http://book.cakephp.org/3.0/en/controllers/components.html
Expand Down Expand Up @@ -320,7 +326,9 @@ public function components()
* This method will also set the component to a property.
* For example:
*
* `$this->loadComponent('Acl.Acl');`
* ```
* $this->loadComponent('Acl.Acl');
* ```
*
* Will result in a `Toolbar` property being set.
*
Expand Down
12 changes: 9 additions & 3 deletions src/Core/App.php
Expand Up @@ -94,12 +94,16 @@ protected static function _classExistsInBase($name, $namespace)
*
* Usage:
*
* `App::path('Plugin');`
* ```
* App::path('Plugin');
* ```
*
* Will return the configured paths for plugins. This is a simpler way to access
* the `App.paths.plugins` configure variable.
*
* `App::path('Model/Datasource', 'MyPlugin');`
* ```
* App::path('Model/Datasource', 'MyPlugin');
* ```
*
* Will return the path for datasources under the 'MyPlugin' plugin.
*
Expand Down Expand Up @@ -130,7 +134,9 @@ public static function path($type, $plugin = null)
*
* Usage:
*
* `App::core('Cache/Engine');`
* ```
* App::core('Cache/Engine');
* ```
*
* Will return the full path to the cache engines package.
*
Expand Down

0 comments on commit eea4bcb

Please sign in to comment.