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

Add GitHub actions #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: CI

on:
# Run on all pushes to master and on all pull requests.
push:
branches:
master
pull_request:
# Allow manually triggering the workflow.
workflow_dispatch:

jobs:
test:
uses: "zetacomponents/.github/.github/workflows/ci.yml@master"
15 changes: 15 additions & 0 deletions .github/workflows/coding-standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Coding Standard

on:
# Run on all pushes and on all pull requests.
push:
branches:
master
pull_request:
# Allow manually triggering the workflow.
workflow_dispatch:

jobs:
test:
uses: "zetacomponents/.github/.github/workflows/coding-standard.yml@master"

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ vendor
run-tests-tmp
extract
composer.lock
.phpcs-cache
8 changes: 7 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@
"require-dev": {
"phpunit/phpunit": "~8.0",
"zetacomponents/database-schema": "~1.5",
"zetacomponents/unit-test": "*"
"zetacomponents/unit-test": "*",
"zetacomponents/coding-standard": "^1.0"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
16 changes: 16 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<ruleset>
<arg name="basepath" value="."/>
<arg name="extensions" value="php"/>
<arg name="cache" value=".phpcs-cache"/>
<arg name="colors"/>

<!-- Ignore warnings, show progress of the run and show sniff names -->
<arg value="nps"/>

<config name="php_version" value="70200"/>

<file>src</file>

<rule ref="ZetaComponents" />
</ruleset>
4 changes: 2 additions & 2 deletions src/db_autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
6 changes: 3 additions & 3 deletions src/exceptions/exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down Expand Up @@ -43,7 +43,7 @@ class ezcDbException extends ezcBaseException
*/
public function __construct( $message )
{
parent::__construct( $message );
parent::__construct( $message );
}
}
?>
4 changes: 2 additions & 2 deletions src/exceptions/handler_not_found.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
4 changes: 2 additions & 2 deletions src/exceptions/missing_parameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
4 changes: 2 additions & 2 deletions src/exceptions/query/invalid.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
4 changes: 2 additions & 2 deletions src/exceptions/query/invalid_parameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
4 changes: 2 additions & 2 deletions src/exceptions/query/variable_parameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
5 changes: 2 additions & 3 deletions src/exceptions/query_exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand All @@ -32,7 +32,6 @@
*/
class ezcQueryException extends ezcBaseException
{

/**
* Constructs an ezcQueryException with the highlevel error
* message $message and the errorcode $code.
Expand Down
4 changes: 2 additions & 2 deletions src/exceptions/transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
6 changes: 3 additions & 3 deletions src/factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down Expand Up @@ -347,7 +347,7 @@ public static function parseDSN( $dsn )
// /database?param1=value1&param2=value2
$parsed['database'] = rawurldecode( substr( $dsn, 0, $pos ) );
$dsn = substr( $dsn, $pos + 1 );
if ( strpos( $dsn, '&') !== false )
if ( strpos( $dsn, '&' ) !== false )
{
$opts = explode( '&', $dsn );
}
Expand Down
2 changes: 1 addition & 1 deletion src/handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ public function quoteIdentifier( $identifier )
$this->identifierQuoteChars["end"],
$this->identifierQuoteChars["end"].$this->identifierQuoteChars["end"],
$identifier
)
)
. $this->identifierQuoteChars["end"];
}
else
Expand Down
4 changes: 2 additions & 2 deletions src/handlers/mssql.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
4 changes: 2 additions & 2 deletions src/handlers/mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
4 changes: 2 additions & 2 deletions src/handlers/oracle.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
4 changes: 2 additions & 2 deletions src/handlers/pgsql.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
4 changes: 2 additions & 2 deletions src/handlers/sqlite.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
4 changes: 2 additions & 2 deletions src/instance.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
11 changes: 6 additions & 5 deletions src/options/identifiers.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down Expand Up @@ -76,7 +76,6 @@ class ezcDbMssqlOptions extends ezcBaseOptions
*/
const QUOTES_UNTOUCHED = 3;


/**
* Creates an ezcDbMssqlOptions object with default option values.
*
Expand Down Expand Up @@ -113,8 +112,10 @@ public function __set( $propertyName, $propertyValue )
)
)
{
throw new ezcBaseValueException( $propertyName, $propertyValue,
'one of ezcDbMssqlOptions::QUOTES_COMPLIANT, QUOTES_LEGACY, QUOTES_GUESS, QUOTES_UNTOUCHED constants' );
throw new ezcBaseValueException(
$propertyName, $propertyValue,
'one of ezcDbMssqlOptions::QUOTES_COMPLIANT, QUOTES_LEGACY, QUOTES_GUESS, QUOTES_UNTOUCHED constants'
);
}

$this->quoteIdentifier = (int) $propertyValue;
Expand Down
4 changes: 2 additions & 2 deletions src/query_autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
6 changes: 4 additions & 2 deletions src/sqlabstraction/expression.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ public function setValuesQuoting( $doQuoting )
$this->quoteValues = $doQuoting;
}


/**
* Returns the SQL to bind logical expressions together using a logical or.
*
Expand Down Expand Up @@ -366,7 +365,7 @@ private function basicMath( $type )
public function add()
{
$args = func_get_args();
return $this->basicMath( '+', $args );
return $this->basicMath( '+', $args );
}

/**
Expand Down Expand Up @@ -714,7 +713,9 @@ public function like( $expression, $pattern )
$expression = $this->getIdentifier( $expression );
return "{$expression} LIKE {$pattern}";
}

// aggregate functions

/**
* Returns the average value of a column
*
Expand Down Expand Up @@ -847,6 +848,7 @@ public function now()
}

// string functions

/**
* Returns part of a string.
*
Expand Down
6 changes: 3 additions & 3 deletions src/sqlabstraction/implementations/expression_mssql.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down Expand Up @@ -193,7 +193,7 @@ public function ceil( $number )
public function unixTimestamp( $column )
{
$column = $this->getIdentifier( $column );
return " DATEDIFF(s, '19700101', {$column} ) - ".date('Z')." ";
return " DATEDIFF(s, '19700101', {$column} ) - ".date( 'Z' )." ";
}

/**
Expand Down
Loading