Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update(github) Update github workflows #292

Merged
merged 2 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[.github/**.yml]
indent_size = 2
indent_style = space
95 changes: 53 additions & 42 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,60 @@
name: "Continuous Integration"

on:
push:
branches:
- master
pull_request:
push:
branches:
- master
pull_request:

env:
fail-fast: true
fail-fast: true

jobs:
tests:
name: "Symfony1 Tests"
runs-on: "ubuntu-22.04"

strategy:
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
memcached-version:
- "1.6"

services:
memcached:
image: "memcached:${{ matrix.memcached-version }}"

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
with:
submodules: "true"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"

- name: "Run Check configuration"
run: "php data/bin/check_configuration.php"

- name: "Run Tests"
run: "php data/bin/symfony symfony:test --trace"
tests:
name: "Symfony1 Tests"
runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
memcached-version:
- "1.6"

services:
memcached:
image: "memcached:${{ matrix.memcached-version }}"

steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: "true"

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --prefer-dist

- name: Run Check configuration
run: php data/bin/check_configuration.php

- name: Run Tests
run: php data/bin/symfony symfony:test --trace
18 changes: 9 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ jobs:
name: 'PHP-CS-Fixer'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v3'
- uses: actions/checkout@v3

- name: 'Setup PHP'
uses: 'shivammathur/setup-php@v2'
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: 8.2
tools: php-cs-fixer, cs2pr

- uses: 'actions/cache@v3'
- uses: actions/cache@v3
with:
path: '.php-cs-fixer.cache'
key: '${{ github.repository }}-8.1-phpcsfixer-${{ github.ref_name }}'
key: ${{ github.repository }}-8.2-phpcsfixer-${{ github.ref_name }}
restore-keys: |
${{ github.repository }}-8.1-phpcsfixer-main
${{ github.repository }}-8.1-phpcsfixer-
${{ github.repository }}-8.2-phpcsfixer-master
${{ github.repository }}-8.2-phpcsfixer-

- name: 'Run PHP-CS-Fixer'
- name: Run PHP-CS-Fixer
# Using cs2pr settings, see: https://github.com/shivammathur/setup-php#tools-with-checkstyle-support
run: 'php-cs-fixer fix --dry-run --format checkstyle | cs2pr'
8 changes: 1 addition & 7 deletions data/bin/check_configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ function is_cli()

/**
* Checks a configuration.
*
* @param mixed $boolean
* @param mixed $message
* @param mixed $help
* @param mixed $fatal
*/
function check($boolean, $message, $help = '', $fatal = false)
{
Expand Down Expand Up @@ -84,8 +79,7 @@ function get_ini_path()
$accelerator =
(function_exists('apc_store') && ini_get('apc.enabled'))
|| function_exists('eaccelerator_put') && ini_get('eaccelerator.enable')
|| function_exists('xcache_set')
;
|| function_exists('xcache_set');
check($accelerator, 'A PHP accelerator is installed', 'Install a PHP accelerator like APC (highly recommended)', false);

check(!ini_get('short_open_tag'), 'php.ini has short_open_tag set to off', 'Set it to off in php.ini', false);
Expand Down
10 changes: 2 additions & 8 deletions lib/action/sfAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,14 @@ public function initialize($context, $moduleName, $actionName)
*
* By default, this method is empty.
*/
public function preExecute()
{
}
public function preExecute() {}

/**
* Execute an application defined process immediately after execution of this sfAction object.
*
* By default, this method is empty.
*/
public function postExecute()
{
}
public function postExecute() {}

/**
* Forwards current action to the default 404 error action.
Expand Down Expand Up @@ -385,8 +381,6 @@ public function setSecurityConfiguration($security)
*
* @param string $name The name of the value to pull from security.yml
* @param mixed $default The default value to return if none is found in security.yml
*
* @return mixed
*/
public function getSecurityValue($name, $default = null)
{
Expand Down
2 changes: 0 additions & 2 deletions lib/action/sfComponents.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ abstract class sfComponents extends sfComponent
/**
* @param sfRequest $request
*
* @return mixed
*
* @throws sfInitializationException
*
* @see sfComponent
Expand Down
13 changes: 2 additions & 11 deletions lib/addon/sfPager.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ public function setCursor($pos)
* Returns an object by cursor position.
*
* @param int $pos
*
* @return mixed
*/
public function getObjectByCursor($pos)
{
Expand All @@ -167,8 +165,6 @@ public function getObjectByCursor($pos)

/**
* Returns the current object.
*
* @return mixed
*/
public function getCurrent()
{
Expand Down Expand Up @@ -396,10 +392,8 @@ public function getParameterHolder()
/**
* Returns a parameter.
*
* @param string $name
* @param mixed $default
*
* @return mixed
* @param string $name
* @param mixed|null $default
*/
public function getParameter($name, $default = null)
{
Expand All @@ -422,7 +416,6 @@ public function hasParameter($name)
* Sets a parameter.
*
* @param string $name
* @param mixed $value
*/
public function setParameter($name, $value)
{
Expand Down Expand Up @@ -525,8 +518,6 @@ public function count()
* Used internally by {@link getCurrent()}.
*
* @param int $offset
*
* @return mixed
*/
abstract protected function retrieveObject($offset);

Expand Down
4 changes: 1 addition & 3 deletions lib/autoload/sfAutoload.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ class sfAutoload
protected $overriden = array();
protected $classes = array();

protected function __construct()
{
}
protected function __construct() {}

/**
* Retrieves the singleton instance of this class.
Expand Down
4 changes: 1 addition & 3 deletions lib/autoload/sfAutoloadAgain.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ class sfAutoloadAgain
/**
* Constructor.
*/
protected function __construct()
{
}
protected function __construct() {}

/**
* Returns the singleton autoloader.
Expand Down
13 changes: 4 additions & 9 deletions lib/cache/sfAPCCache.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class sfAPCCache extends sfCache
* * see sfCache for options available for all drivers
*
* @see sfCache
* {@inheritdoc}
*/
public function initialize($options = array())
{
Expand All @@ -38,7 +37,8 @@ public function initialize($options = array())

/**
* @see sfCache
* {@inheritdoc}
*
* @param mixed|null $default
*/
public function get($key, $default = null)
{
Expand All @@ -53,7 +53,6 @@ public function get($key, $default = null)

/**
* @see sfCache
* {@inheritdoc}
*/
public function has($key)
{
Expand All @@ -68,7 +67,8 @@ public function has($key)

/**
* @see sfCache
* {@inheritdoc}
*
* @param mixed|null $lifetime
*/
public function set($key, $data, $lifetime = null)
{
Expand All @@ -81,7 +81,6 @@ public function set($key, $data, $lifetime = null)

/**
* @see sfCache
* {@inheritdoc}
*/
public function remove($key)
{
Expand All @@ -94,7 +93,6 @@ public function remove($key)

/**
* @see sfCache
* {@inheritdoc}
*/
public function clean($mode = sfCache::ALL)
{
Expand All @@ -109,7 +107,6 @@ public function clean($mode = sfCache::ALL)

/**
* @see sfCache
* {@inheritdoc}
*/
public function getLastModified($key)
{
Expand All @@ -122,7 +119,6 @@ public function getLastModified($key)

/**
* @see sfCache
* {@inheritdoc}
*/
public function getTimeout($key)
{
Expand All @@ -135,7 +131,6 @@ public function getTimeout($key)

/**
* @see sfCache
* {@inheritdoc}
*/
public function removePattern($pattern)
{
Expand Down
2 changes: 0 additions & 2 deletions lib/cache/sfCache.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,6 @@ public function getOption($name, $default = null)
*
* @param string $name The option name
* @param mixed $value The option value
*
* @return mixed
*/
public function setOption($name, $value)
{
Expand Down
Loading