Skip to content

Commit a667dc0

Browse files
authored
Merge pull request #930 from sergeyklay/3.0.x
Update stubs
2 parents e1ae17e + fe6cb1e commit a667dc0

File tree

369 files changed

+5180
-2280
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

369 files changed

+5180
-2280
lines changed

ide/stubs/Phalcon/Acl.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,47 @@
11
<?php
22

33
namespace Phalcon;
4+
45
/**
56
* Phalcon\Acl
7+
*
68
* This component allows to manage ACL lists. An access control list (ACL) is a list
79
* of permissions attached to an object. An ACL specifies which users or system processes
810
* are granted access to objects, as well as what operations are allowed on given objects.
11+
*
912
* <code>
1013
* use Phalcon\Acl;
1114
* use Phalcon\Acl\Role;
1215
* use Phalcon\Acl\Resource;
1316
* use Phalcon\Acl\Adapter\Memory;
17+
*
1418
* $acl = new Memory();
19+
*
1520
* // Default action is deny access
1621
* $acl->setDefaultAction(Acl::DENY);
22+
*
1723
* // Create some roles
1824
* $roleAdmins = new Role("Administrators", "Super-User role");
1925
* $roleGuests = new Role("Guests");
26+
*
2027
* // Add "Guests" role to acl
2128
* $acl->addRole($roleGuests);
29+
*
2230
* // Add "Designers" role to acl
2331
* $acl->addRole("Designers");
32+
*
2433
* // Define the "Customers" resource
2534
* $customersResource = new Resource("Customers", "Customers management");
35+
*
2636
* // Add "customers" resource with a couple of operations
2737
* $acl->addResource($customersResource, "search");
2838
* $acl->addResource($customersResource, ["create", "update"]);
39+
*
2940
* // Set access level for roles into resources
3041
* $acl->allow("Guests", "Customers", "search");
3142
* $acl->allow("Guests", "Customers", "create");
3243
* $acl->deny("Guests", "Customers", "update");
44+
*
3345
* // Check whether role has access to the operations
3446
* $acl->isAllowed("Guests", "Customers", "edit"); // Returns 0
3547
* $acl->isAllowed("Guests", "Customers", "search"); // Returns 1

ide/stubs/Phalcon/Application.php

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?php
22

33
namespace Phalcon;
4+
45
/**
56
* Phalcon\Application
7+
*
68
* Base class for Phalcon\Cli\Console and Phalcon\Mvc\Application.
79
*/
810
abstract class Application extends \Phalcon\Di\Injectable implements \Phalcon\Events\EventsAwareInterface
@@ -48,18 +50,19 @@ public function getEventsManager() {}
4850

4951
/**
5052
* Register an array of modules present in the application
53+
*
5154
* <code>
5255
* $this->registerModules(
53-
* [
54-
* "frontend" => [
55-
* "className" => "Multiple\\Frontend\\Module",
56-
* "path" => "../apps/frontend/Module.php",
57-
* ],
58-
* "backend" => [
59-
* "className" => "Multiple\\Backend\\Module",
60-
* "path" => "../apps/backend/Module.php",
61-
* ],
62-
* ]
56+
* [
57+
* "frontend" => [
58+
* "className" => "Multiple\\Frontend\\Module",
59+
* "path" => "../apps/frontend/Module.php",
60+
* ],
61+
* "backend" => [
62+
* "className" => "Multiple\\Backend\\Module",
63+
* "path" => "../apps/backend/Module.php",
64+
* ],
65+
* ]
6366
* );
6467
* </code>
6568
*

ide/stubs/Phalcon/Config.php

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
11
<?php
22

33
namespace Phalcon;
4+
45
/**
56
* Phalcon\Config
7+
*
68
* Phalcon\Config is designed to simplify the access to, and the use of, configuration data within applications.
79
* It provides a nested object property based user interface for accessing this configuration data within
810
* application code.
11+
*
912
* <code>
1013
* $config = new \Phalcon\Config(
11-
* [
12-
* "database" => [
13-
* "adapter" => "Mysql",
14-
* "host" => "localhost",
15-
* "username" => "scott",
16-
* "password" => "cheetah",
17-
* "dbname" => "test_db",
18-
* ],
19-
* "phalcon" => [
20-
* "controllersDir" => "../app/controllers/",
21-
* "modelsDir" => "../app/models/",
22-
* "viewsDir" => "../app/views/",
23-
* ],
24-
* ]
14+
* [
15+
* "database" => [
16+
* "adapter" => "Mysql",
17+
* "host" => "localhost",
18+
* "username" => "scott",
19+
* "password" => "cheetah",
20+
* "dbname" => "test_db",
21+
* ],
22+
* "phalcon" => [
23+
* "controllersDir" => "../app/controllers/",
24+
* "modelsDir" => "../app/models/",
25+
* "viewsDir" => "../app/views/",
26+
* ],
27+
* ]
2528
* );
2629
* </code>
2730
*/
@@ -37,9 +40,10 @@ public function __construct(array $arrayConfig = null) {}
3740

3841
/**
3942
* Allows to check whether an attribute is defined using the array-syntax
43+
*
4044
* <code>
4145
* var_dump(
42-
* isset($config["database"])
46+
* isset($config["database"])
4347
* );
4448
* </code>
4549
*
@@ -51,6 +55,7 @@ public function offsetExists($index) {}
5155
/**
5256
* Gets an attribute from the configuration, if the attribute isn't defined returns null
5357
* If the value is exactly null or is not defined the default value will be used instead
58+
*
5459
* <code>
5560
* echo $config->get("controllersDir", "../app/controllers/");
5661
* </code>
@@ -63,9 +68,10 @@ public function get($index, $defaultValue = null) {}
6368

6469
/**
6570
* Gets an attribute using the array-syntax
71+
*
6672
* <code>
6773
* print_r(
68-
* $config["database"]
74+
* $config["database"]
6975
* );
7076
* </code>
7177
*
@@ -76,9 +82,10 @@ public function offsetGet($index) {}
7682

7783
/**
7884
* Sets an attribute using the array-syntax
85+
*
7986
* <code>
8087
* $config["database"] = [
81-
* "type" => "Sqlite",
88+
* "type" => "Sqlite",
8289
* ];
8390
* </code>
8491
*
@@ -89,6 +96,7 @@ public function offsetSet($index, $value) {}
8996

9097
/**
9198
* Unsets an attribute using the array-syntax
99+
*
92100
* <code>
93101
* unset($config["database"]);
94102
* </code>
@@ -99,14 +107,16 @@ public function offsetUnset($index) {}
99107

100108
/**
101109
* Merges a configuration into the current one
110+
*
102111
* <code>
103112
* $appConfig = new \Phalcon\Config(
104-
* [
105-
* "database" => [
106-
* "host" => "localhost",
107-
* ],
108-
* ]
113+
* [
114+
* "database" => [
115+
* "host" => "localhost",
116+
* ],
117+
* ]
109118
* );
119+
*
110120
* $globalConfig->merge($appConfig);
111121
* </code>
112122
*
@@ -117,9 +127,10 @@ public function merge(Config $config) {}
117127

118128
/**
119129
* Converts recursively the object to an array
130+
*
120131
* <code>
121132
* print_r(
122-
* $config->toArray()
133+
* $config->toArray()
123134
* );
124135
* </code>
125136
*
@@ -129,10 +140,13 @@ public function toArray() {}
129140

130141
/**
131142
* Returns the count of properties set in the config
143+
*
132144
* <code>
133145
* print count($config);
134146
* </code>
147+
*
135148
* or
149+
*
136150
* <code>
137151
* print $config->count();
138152
* </code>
@@ -152,8 +166,11 @@ public static function __set_state(array $data) {}
152166
/**
153167
* Helper method for merge configs (forwarding nested config instance)
154168
*
169+
*
170+
* @param Config instance = null
171+
*
155172
* @param Config $config
156-
* @param Config $instance = null
173+
* @param mixed $instance
157174
* @return Config
158175
*/
159176
protected final function _merge(Config $config, $instance = null) {}

ide/stubs/Phalcon/Crypt.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
<?php
22

33
namespace Phalcon;
4+
45
/**
56
* Phalcon\Crypt
7+
*
68
* Provides encryption facilities to phalcon applications
9+
*
710
* <code>
811
* $crypt = new \Phalcon\Crypt();
12+
*
913
* $key = "le password";
1014
* $text = "This is a secret text";
15+
*
1116
* $encrypted = $crypt->encrypt($text, $key);
17+
*
1218
* echo $crypt->decrypt($encrypted, $key);
1319
* </code>
1420
*/
@@ -86,6 +92,7 @@ public function getKey() {}
8692
/**
8793
* Pads texts before encryption
8894
*
95+
*
8996
* @see http://www.di-mgt.com.au/cryptopad.html
9097
* @param string $text
9198
* @param string $mode
@@ -98,6 +105,7 @@ protected function _cryptPadText($text, $mode, $blockSize, $paddingType) {}
98105
* Removes padding @a padding_type from @a text
99106
* If the function detects that the text was not padded, it will return it unmodified
100107
*
108+
*
101109
* @param string $text Message to be unpadded
102110
* @param string $mode Encryption mode; unpadding is applied only in CBC or ECB mode
103111
* @param int $blockSize Cipher block size
@@ -107,6 +115,7 @@ protected function _cryptUnpadText($text, $mode, $blockSize, $paddingType) {}
107115

108116
/**
109117
* Encrypts a text
118+
*
110119
* <code>
111120
* $encrypted = $crypt->encrypt("Ultra-secret text", "encrypt password");
112121
* </code>
@@ -119,6 +128,7 @@ public function encrypt($text, $key = null) {}
119128

120129
/**
121130
* Decrypts an encrypted text
131+
*
122132
* <code>
123133
* echo $crypt->decrypt($encrypted, "decrypt password");
124134
* </code>

ide/stubs/Phalcon/CryptInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?php
22

33
namespace Phalcon;
4+
45
/**
56
* Phalcon\CryptInterface
7+
*
68
* Interface for Phalcon\Crypt
79
*/
810
interface CryptInterface

ide/stubs/Phalcon/Db.php

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,46 @@
11
<?php
22

33
namespace Phalcon;
4+
45
/**
56
* Phalcon\Db
7+
*
68
* Phalcon\Db and its related classes provide a simple SQL database interface for Phalcon Framework.
79
* The Phalcon\Db is the basic class you use to connect your PHP application to an RDBMS.
810
* There is a different adapter class for each brand of RDBMS.
11+
*
912
* This component is intended to lower level database operations. If you want to interact with databases using
1013
* higher level of abstraction use Phalcon\Mvc\Model.
14+
*
1115
* Phalcon\Db is an abstract class. You only can use it with a database adapter like Phalcon\Db\Adapter\Pdo
16+
*
1217
* <code>
1318
* use Phalcon\Db;
1419
* use Phalcon\Db\Exception;
1520
* use Phalcon\Db\Adapter\Pdo\Mysql as MysqlConnection;
21+
*
1622
* try {
17-
* $connection = new MysqlConnection(
18-
* [
19-
* "host" => "192.168.0.11",
20-
* "username" => "sigma",
21-
* "password" => "secret",
22-
* "dbname" => "blog",
23-
* "port" => "3306",
24-
* ]
25-
* );
26-
* $result = $connection->query(
27-
* "SELECTFROM robots LIMIT 5"
28-
* );
29-
* $result->setFetchMode(Db::FETCH_NUM);
30-
* while ($robot = $result->fetch()) {
31-
* print_r($robot);
32-
* }
23+
* $connection = new MysqlConnection(
24+
* [
25+
* "host" => "192.168.0.11",
26+
* "username" => "sigma",
27+
* "password" => "secret",
28+
* "dbname" => "blog",
29+
* "port" => "3306",
30+
* ]
31+
* );
32+
*
33+
* $result = $connection->query(
34+
* "SELECT FROM robots LIMIT 5"
35+
* );
36+
*
37+
* $result->setFetchMode(Db::FETCH_NUM);
38+
*
39+
* while ($robot = $result->fetch()) {
40+
* print_r($robot);
41+
* }
3342
* } catch (Exception $e) {
34-
* echo $e->getMessage(), PHP_EOL;
43+
* echo $e->getMessage(), PHP_EOL;
3544
* }
3645
* </code>
3746
*/

ide/stubs/Phalcon/Debug.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?php
22

33
namespace Phalcon;
4+
45
/**
56
* Phalcon\Debug
7+
*
68
* Provides debug capabilities to Phalcon applications
79
*/
810
class Debug

0 commit comments

Comments
 (0)