File tree Expand file tree Collapse file tree 17 files changed +30
-27
lines changed
appengine/php72/getting-started/test Expand file tree Collapse file tree 17 files changed +30
-27
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ return PhpCsFixer\Config::create()
1010 'method_argument_space ' => [
1111 'keep_multiple_spaces_after_comma ' => true
1212 ],
13+ 'return_type_declaration ' => [
14+ 'space_before ' => 'none '
15+ ],
1316 ])
1417 ->setFinder (
1518 PhpCsFixer \Finder::create ()
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ class CloudSqlTest extends TestCase
2525{
2626 use TestTrait;
2727
28- public function setUp () : void
28+ public function setUp (): void
2929 {
3030 $ connection = $ this ->requireEnv ('CLOUDSQL_CONNECTION_NAME ' );
3131 $ dbUser = $ this ->requireEnv ('CLOUDSQL_USER ' );
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ public function createTableIfNotExists()
6868 *
6969 * @return array
7070 */
71- public function listVotes () : array
71+ public function listVotes (): array
7272 {
7373 $ sql = "SELECT vote_value, time_cast FROM votes ORDER BY time_cast DESC LIMIT 5 " ;
7474 $ statement = $ this ->connection ->prepare ($ sql );
@@ -82,7 +82,7 @@ public function listVotes() : array
8282 * @param string $value
8383 * @param int
8484 */
85- public function getCountByValue (string $ value ) : int
85+ public function getCountByValue (string $ value ): int
8686 {
8787 $ sql = "SELECT COUNT(vote_id) as voteCount FROM votes WHERE vote_value = ? " ;
8888
@@ -98,7 +98,7 @@ public function getCountByValue(string $value) : int
9898 * @param string $value The value to vote for.
9999 * @return boolean
100100 */
101- public function insertVote (string $ value ) : bool
101+ public function insertVote (string $ value ): bool
102102 {
103103 $ conn = $ this ->connection ;
104104 $ res = false ;
Original file line number Diff line number Diff line change 5454/**
5555 * @param $conn_config array driver-specific options for PDO
5656 */
57- function init_tcp_database_connection (array $ conn_config ) : PDO
57+ function init_tcp_database_connection (array $ conn_config ): PDO
5858{
5959 $ username = getenv ('DB_USER ' );
6060 $ password = getenv ('DB_PASS ' );
@@ -107,7 +107,7 @@ function init_tcp_database_connection(array $conn_config) : PDO
107107/**
108108 * @param $conn_config array driver-specific options for PDO
109109 */
110- function init_unix_database_connection (array $ conn_config ) : PDO
110+ function init_unix_database_connection (array $ conn_config ): PDO
111111{
112112 $ username = getenv ('DB_USER ' );
113113 $ password = getenv ('DB_PASS ' );
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ class VotesTest extends TestCase
2929{
3030 private $ conn ;
3131
32- public function setUp () : void
32+ public function setUp (): void
3333 {
3434 $ this ->conn = $ this ->prophesize (PDO ::class);
3535 }
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ public function createTableIfNotExists()
6868 *
6969 * @return array
7070 */
71- public function listVotes () : array
71+ public function listVotes (): array
7272 {
7373 $ sql = "SELECT vote_value, time_cast FROM votes ORDER BY time_cast DESC LIMIT 5 " ;
7474 $ statement = $ this ->connection ->prepare ($ sql );
@@ -82,7 +82,7 @@ public function listVotes() : array
8282 * @param string $value
8383 * @param int
8484 */
85- public function getCountByValue (string $ value ) : int
85+ public function getCountByValue (string $ value ): int
8686 {
8787 $ sql = "SELECT COUNT(vote_id) as voteCount FROM votes WHERE vote_value = ? " ;
8888
@@ -98,7 +98,7 @@ public function getCountByValue(string $value) : int
9898 * @param string $value The value to vote for.
9999 * @return boolean
100100 */
101- public function insertVote (string $ value ) : bool
101+ public function insertVote (string $ value ): bool
102102 {
103103 $ conn = $ this ->connection ;
104104 $ res = false ;
Original file line number Diff line number Diff line change 5454/**
5555 * @param $conn_config array driver-specific options for PDO
5656 */
57- function init_tcp_database_connection (array $ conn_config ) : PDO
57+ function init_tcp_database_connection (array $ conn_config ): PDO
5858{
5959 $ username = getenv ('DB_USER ' );
6060 $ password = getenv ('DB_PASS ' );
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ class VotesTest extends TestCase
2929{
3030 private $ conn ;
3131
32- public function setUp () : void
32+ public function setUp (): void
3333 {
3434 $ this ->conn = $ this ->prophesize (PDO ::class);
3535 }
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ public function createTableIfNotExists()
7474 *
7575 * @return array
7676 */
77- public function listVotes () : array
77+ public function listVotes (): array
7878 {
7979 $ sql = "SELECT TOP 5 vote_value, time_cast FROM votes ORDER BY time_cast DESC " ;
8080 $ statement = $ this ->connection ->prepare ($ sql );
@@ -88,7 +88,7 @@ public function listVotes() : array
8888 * @param string $value
8989 * @param int
9090 */
91- public function getCountByValue (string $ value ) : int
91+ public function getCountByValue (string $ value ): int
9292 {
9393 $ sql = "SELECT COUNT(vote_id) as voteCount FROM votes WHERE vote_value = ? " ;
9494
@@ -104,7 +104,7 @@ public function getCountByValue(string $value) : int
104104 * @param string $value The value to vote for.
105105 * @return boolean
106106 */
107- public function insertVote (string $ value ) : bool
107+ public function insertVote (string $ value ): bool
108108 {
109109 $ conn = $ this ->connection ;
110110 $ res = false ;
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ class VotesTest extends TestCase
2929{
3030 private $ conn ;
3131
32- public function setUp () : void
32+ public function setUp (): void
3333 {
3434 $ this ->conn = $ this ->prophesize (PDO ::class);
3535 }
You can’t perform that action at this time.
0 commit comments