Skip to content

Commit

Permalink
Updated stubs regarding to the 3.2.0 version
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyklay committed Jun 18, 2017
1 parent 9279b4a commit 326033e
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 22 deletions.
9 changes: 6 additions & 3 deletions src/Phalcon/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ abstract class Text
const RANDOM_NOZERO = 4;


const RANDOM_DISTINCT = 5;


/**
* Converts strings to camelize style
*
Expand Down Expand Up @@ -72,10 +75,10 @@ public static function increment($str, $separator = "_") {}
* Generates a random string based on the given type. Type is one of the RANDOM_ constants
*
* <code>
* use Phalcon\Text;
*
* // "aloiwkqz"
* echo Phalcon\Text::random(
* Phalcon\Text::RANDOM_ALNUM
* );
* echo Text::random(Text::RANDOM_ALNUM);
* </code>
*
* @param int $type
Expand Down
24 changes: 8 additions & 16 deletions src/Phalcon/assets/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,21 +176,6 @@ public function set($id, \Phalcon\Assets\Collection $collection) {}
*/
public function get($id) {}

/**
* Checks whether the Assets Manager has Collection.
*
* <code>
* if ($assets->has("jsHeader")) {
* // \Phalcon\Assets\Collection
* $collection = $assets->get("jsHeader");
* }
* </code>
*
* @param string $id
* @return bool
*/
public function has($id) {}

/**
* Returns the CSS collection of assets
*
Expand Down Expand Up @@ -272,7 +257,14 @@ public function outputInlineJs($collectionName = null) {}
public function getCollections() {}

/**
* Returns true or false if collection exists
* Returns true or false if collection exists.
*
* <code>
* if ($assets->exists("jsHeader")) {
* // \Phalcon\Assets\Collection
* $collection = $assets->get("jsHeader");
* }
* </code>
*
* @param string $id
* @return bool
Expand Down
31 changes: 28 additions & 3 deletions src/Phalcon/cli/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
* instantiating a task and calling an action on it.
*
* <code>
* $di = new \Phalcon\Di();
*
* $dispatcher = new \Phalcon\Cli\Dispatcher();
* use Phalcon\Di;
* use Phalcon\Cli\Dispatcher;
*
* $di = new Di();
* $dispatcher = new Dispatcher();
* $dispatcher->setDi($di);
*
* $dispatcher->setTaskName("posts");
Expand Down Expand Up @@ -110,9 +111,33 @@ public function setOptions(array $options) {}
public function getOptions() {}

/**
* Gets an option by its name or numeric index
*
* @param mixed $option
* @param mixed $filters
* @param mixed $defaultValue
* @param mixed $$option
* @param string|array $$filters
* @param mixed $$defaultValue
* @return mixed
*/
public function getOption($option, $filters = null, $defaultValue = null) {}

/**
* Check if an option exists
*
* @param mixed $option
* @return bool
*/
public function hasOption($option) {}

/**
* Calls the action method.
*
* @param mixed $handler
* @param string $actionMethod
* @param array $params
* @return mixed
*/
public function callActionMethod($handler, $actionMethod, array $params = array()) {}

Expand Down
68 changes: 68 additions & 0 deletions src/Phalcon/config/adapter/Grouped.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php

namespace Phalcon\Config\Adapter;

/**
* Phalcon\Config\Adapter\Grouped
*
* Reads multiple files (or arrays) and merges them all together.
*
* @see Phalcon\Config\Factory::load To load Config Adapter class using 'adapter' option.
*
* <code>
* use Phalcon\Config\Adapter\Grouped;
*
* $config = new Grouped(
* [
* "path/to/config.php",
* "path/to/config.dist.php",
* ]
* );
* </code>
*
* <code>
* use Phalcon\Config\Adapter\Grouped;
*
* $config = new Grouped(
* [
* "path/to/config.json",
* "path/to/config.dist.json",
* ],
* "json"
* );
* </code>
*
* <code>
* use Phalcon\Config\Adapter\Grouped;
*
* $config = new Grouped(
* [
* [
* "filePath" => "path/to/config.php",
* "adapter" => "php",
* ],
* [
* "filePath" => "path/to/config.json",
* "adapter" => "json",
* ],
* [
* "adapter" => "array",
* "config" => [
* "property" => "value",
* ],
* ],
* );
* </code>
*/
class Grouped extends \Phalcon\Config
{

/**
* Phalcon\Config\Adapter\Grouped constructor
*
* @param array $arrayConfig
* @param string $defaultAdapter
*/
public function __construct(array $arrayConfig, $defaultAdapter = "php") {}

}
28 changes: 28 additions & 0 deletions src/Phalcon/validation/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,32 @@ public function setOption($key, $value) {}
*/
abstract public function validate(\Phalcon\Validation $validation, $attribute);

/**
* Prepares a label for the field.
*
* @param \Phalcon\Validation $validation
* @param string $field
* @return mixed
*/
protected function prepareLabel(\Phalcon\Validation $validation, $field) {}

/**
* Prepares a validation message.
*
* @param \Phalcon\Validation $validation
* @param string $field
* @param string $type
* @param string $option
* @return mixed
*/
protected function prepareMessage(\Phalcon\Validation $validation, $field, $type, $option = "message") {}

/**
* Prepares a validation code.
*
* @param string $field
* @return int|null
*/
protected function prepareCode($field) {}

}

0 comments on commit 326033e

Please sign in to comment.