Skip to content

Commit

Permalink
Merge pull request #9 from markstory/add-templatestrings
Browse files Browse the repository at this point in the history
Add templatestrings
  • Loading branch information
markstory committed Mar 3, 2023
2 parents c6d7d1f + 6e96c0e commit b77f414
Show file tree
Hide file tree
Showing 9 changed files with 299 additions and 227 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ on:

jobs:
testsuite:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php-version: ['7.2', '7.4']
php-version: ['7.4', '8.2']
prefer-lowest: ['']
include:
- php-version: '7.2'
- php-version: '7.4'
prefer-lowest: 'prefer-lowest'

steps:
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ next.

### Include without pre-configuration

To use the helper, include the helper in your controller:
To use the helper, include the helper in your View:

```php
public $helpers = array('Geshi.Geshi');
public $helpers = ['Geshi.Geshi'];
```

You will have to include a `geshi.php` configuration file or simply set the
Expand All @@ -48,11 +48,11 @@ To use the helper and specify specific GeSHi features, use the options form
of including helpers:

```php
public $helpers = array(
'Geshi.Geshi' => array(
'set_header_type' => array('GESHI_FANCY_LINE_NUMBERS',5)
)
);
public $helpers = [
'Geshi.Geshi' => [
'set_header_type' => ['GESHI_FANCY_LINE_NUMBERS', 5]
]
];
```

Where the passed-in key is a GeSHi function name, and the passed-in values
Expand Down Expand Up @@ -106,9 +106,9 @@ You can configure GeSHI's features from within your views
by accessing the `$features` variable so: `$this->Geshi->features = array(...)`, for example:

```php
$this->Geshi->features = array(
'geshi_function_name' => array('geshi_parameter', list, values)
);
$this->Geshi->setConfig('features', [
'geshi_function_name' => ['geshi_parameter', list, values]
]);
```

Note that GeSHI's constants _are_ in scope here, and so quoting parameter
Expand Down
14 changes: 10 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,20 @@
}
},
"require": {
"php": ">=7.2.0",
"php": ">=7.4.0",
"cakephp/cakephp": "^4.0",
"cakephp/plugin-installer": "*",
"geshi/geshi": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^8"
"phpunit/phpunit": "^8",
"cakephp/cakephp-codesniffer": "^4.0"
},
"minimum-stability": "dev",
"prefer-stable": true
"prefer-stable": true,
"config": {
"allow-plugins": {
"cakephp/plugin-installer": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
8 changes: 8 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<ruleset name="Application">
<config name="installed_paths" value="../../cakephp/cakephp-codesniffer" />

<rule ref="CakePHP" />

<arg value="s"/>
</ruleset>
2 changes: 2 additions & 0 deletions src/Plugin.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

namespace Geshi;

use Cake\Core\BasePlugin;
Expand Down
Loading

0 comments on commit b77f414

Please sign in to comment.