Skip to content

Commit ece828d

Browse files
committed
Improve code detaction for cake static classes
1 parent c52493e commit ece828d

Some content is hidden

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

53 files changed

+140
-140
lines changed

docs/2.x/appendices/migrating-from-cakephp-1-2-to-1-3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ hit, and the related features have been refactored into a method to
106106
increase their flexibility. You now use `Inflector::rules()` to
107107
load custom inflections:
108108

109-
``` css
109+
``` php
110110
Inflector::rules('singular', array(
111111
'rules' => array(
112112
'/^(bil)er$/i' => '\1',

docs/2.x/contributing/documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ matching directive is found:
356356
357357
> Reference a method of a class. This role supports both kinds of methods:
358358
>
359-
> ``` text
359+
> ``` php
360360
> :php:meth:`DateTime::setDate`
361361
> :php:meth:`Classname::staticMethod`
362362
> ```

docs/2.x/core-libraries/helpers/time.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ Formatting
316316
> Use the 'accuracy' option to determine how precise the output should be.
317317
> You can use this to limit the output:
318318
>
319-
> ``` text
319+
> ``` php
320320
> // If $timestamp is 1 month, 1 week, 5 days and 6 hours ago
321321
> echo CakeTime::timeAgoInWords($timestamp, array(
322322
> 'accuracy' => array('month' => 'month'),

docs/2.x/development/configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ special cases.
786786
You can use `Inflector::rules()` in the file
787787
`app/Config/bootstrap.php` to load custom inflections:
788788

789-
``` css
789+
``` php
790790
Inflector::rules('singular', array(
791791
'rules' => array(
792792
'/^(bil)er$/i' => '\1',
@@ -799,7 +799,7 @@ Inflector::rules('singular', array(
799799

800800
or:
801801

802-
``` css
802+
``` php
803803
Inflector::rules('plural', array('irregular' => array('phylum' => 'phyla')));
804804
```
805805

docs/3.x/appendices/3-0-migration-guide.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ __('Today is a {0} day in {1}', 'Sunny', 'Spain');
993993

994994
You can avoid rewriting your messages by using the old `sprintf` formatter:
995995

996-
``` css
996+
``` php
997997
I18n::defaultFormatter('sprintf');
998998
```
999999

@@ -1076,7 +1076,7 @@ The folder and file classes have been renamed:
10761076
of regular expressions, transliterations use simple string replacement. This
10771077
yielded significant performance improvements:
10781078

1079-
``` text
1079+
``` php
10801080
// Instead of
10811081
Inflector::rules('transliteration', [
10821082
'/ä|æ/' => 'ae',
@@ -1156,7 +1156,7 @@ help of the `intl` extension.
11561156

11571157
In general, expressions looking like this:
11581158

1159-
``` css
1159+
``` php
11601160
CakeTime::aMethod($date);
11611161
```
11621162

docs/3.x/contributing/documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ matching directive is found:
354354
355355
> Reference a method of a class. This role supports both kinds of methods:
356356
>
357-
> ``` text
357+
> ``` php
358358
> :php:meth:`DateTime::setDate`
359359
> :php:meth:`Classname::staticMethod`
360360
> ```

docs/3.x/core-libraries/inflector.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Both `pluralize` and `singularize()` work on most English nouns. If you need
4545
to support other languages, you can use [Inflection Configuration](#inflection-configuration) to
4646
customize the rules used:
4747

48-
``` text
48+
``` php
4949
// Apples
5050
echo Inflector::pluralize('Apple');
5151
```
@@ -65,7 +65,7 @@ echo Inflector::singularize('People');
6565

6666
These methods are useful when creating class names, or property names:
6767

68-
``` text
68+
``` php
6969
// ApplePie
7070
Inflector::camelize('Apple_pie')
7171

@@ -82,7 +82,7 @@ underscore.
8282
This method is useful when converting underscored forms into "Title Case" forms
8383
for human readable values:
8484

85-
``` text
85+
``` php
8686
// Apple Pie
8787
Inflector::humanize('apple_pie');
8888
```
@@ -92,7 +92,7 @@ Inflector::humanize('apple_pie');
9292
When generating code, or using CakePHP's conventions you may need to inflect
9393
table names or class names:
9494

95-
``` text
95+
``` php
9696
// UserProfileSetting
9797
Inflector::classify('user_profile_settings');
9898

@@ -108,7 +108,7 @@ Inflector::tableize('UserProfileSetting');
108108
Variable names are often useful when doing meta-programming tasks that involve
109109
generating code or doing work based on conventions:
110110

111-
``` text
111+
``` php
112112
// applePie
113113
Inflector::variable('apple_pie');
114114
```
@@ -118,7 +118,7 @@ Inflector::variable('apple_pie');
118118
Slug converts special characters into latin versions and converting unmatched
119119
characters and spaces to dashes. The slug method expects UTF-8 encoding:
120120

121-
``` text
121+
``` php
122122
// apple-puree
123123
Inflector::slug('apple purée');
124124
```
@@ -148,7 +148,7 @@ special cases.
148148
Define new inflection and transliteration rules for Inflector to use. Often,
149149
this method is used in your **config/bootstrap.php**:
150150

151-
``` css
151+
``` php
152152
Inflector::rules('singular', ['/^(bil)er$/i' => '\1', '/^(inflec|contribu)tors$/i' => '\1ta']);
153153
Inflector::rules('uninflected', ['singulars']);
154154
Inflector::rules('irregular', ['phylum' => 'phyla']); // The key is singular form, value is plural form

docs/3.x/core-libraries/internationalization-and-localization.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ minimum that is required for creating a translator is that the loader function
440440
should return a `Aura\Intl\Package` object. Once the code is in place you can
441441
use the translation functions as usual:
442442

443-
``` text
443+
``` php
444444
// Prior to 3.5 use I18n::locale()
445445
I18n::setLocale('fr_FR');
446446
__d('animals', 'Dog'); // Returns "Chien"
@@ -542,7 +542,7 @@ If you'd like to change how packages are loaded for all packages, that don't
542542
have specific loaders set you can replace the fallback package loader by using
543543
the `_fallback` package:
544544

545-
``` css
545+
``` php
546546
I18n::config('_fallback', function ($domain, $locale) {
547547
// Custom code that yields a package here.
548548
});
@@ -606,7 +606,7 @@ It is possible to set the default formatter for all translators created by
606606
CakePHP before they are used for the first time. This does not include manually
607607
created translators using the `setTranslator()` and `config()` methods:
608608

609-
``` css
609+
``` php
610610
I18n::defaultFormatter('sprintf');
611611
```
612612

docs/3.x/core-libraries/number.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ If `$currency` value is `null`, the default currency will be retrieved from
8383
`Cake\I18n\Number::defaultCurrency()`. To format currencies in an
8484
accounting format you should set the currency format:
8585

86-
``` css
86+
``` php
8787
Number::setDefaultCurrencyFormat(Number::FORMAT_CURRENCY_ACCOUNTING);
8888
```
8989

@@ -247,7 +247,7 @@ This method will output an ordinal number.
247247

248248
Examples:
249249

250-
``` text
250+
``` php
251251
echo Number::ordinal(1);
252252
// Output '1st'
253253

@@ -322,7 +322,7 @@ to various methods.
322322

323323
Example:
324324

325-
``` css
325+
``` php
326326
Number::config('en_IN', \NumberFormatter::CURRENCY, [
327327
'pattern' => '#,##,##0'
328328
]);

docs/3.x/core-libraries/text.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ multiple conversion pairs separated by `;`. You can find more info about
4848
transliterator identifiers
4949
[here](https://unicode-org.github.io/icu/userguide/transforms/general/#transliterator-identifiers):
5050

51-
``` text
51+
``` php
5252
// apple puree
5353
Text::transliterate('apple purée');
5454

@@ -74,7 +74,7 @@ options are:
7474
- `preserve` Specific non-word character to preserve. Defaults to `null`.
7575
For e.g. this option can be set to '.' to generate clean file names:
7676

77-
``` text
77+
``` php
7878
// apple-puree
7979
Text::slug('apple purée');
8080

@@ -91,7 +91,7 @@ The UUID method is used to generate unique identifiers as per `4122`. The
9191
UUID is a 128-bit string in the format of
9292
`485fc381-e790-47a3-9794-1337c0a8fe68`. :
9393

94-
``` css
94+
``` php
9595
Text::uuid(); // 485fc381-e790-47a3-9794-1337c0a8fe68
9696
```
9797

@@ -124,7 +124,7 @@ $int = Text::parseFileSize('2GB');
124124
The insert method is used to create string templates and to allow for key/value
125125
replacements:
126126

127-
``` css
127+
``` php
128128
Text::insert(
129129
'My name is :name and I am :age years old.',
130130
['name' => 'Bob', 'age' => '65']

0 commit comments

Comments
 (0)