diff --git a/.php_cs b/.php_cs deleted file mode 100644 index 3cd1a16a01..0000000000 --- a/.php_cs +++ /dev/null @@ -1,17 +0,0 @@ -in(__DIR__) -; - -return Symfony\CS\Config\Config::create() - ->level(Symfony\CS\FixerInterface::PSR2_LEVEL) - ->fixers([ - 'concat_with_spaces', - 'unused_use', - 'trailing_spaces', - 'indentation', - '-psr0' - ]) - ->finder($finder) -; diff --git a/.php_cs.dist b/.php_cs.dist new file mode 100644 index 0000000000..f52c9327a2 --- /dev/null +++ b/.php_cs.dist @@ -0,0 +1,15 @@ +setRules([ + '@PSR2' => true, + 'concat_space' => ['spacing' => 'one'], + 'no_unused_imports' => true, + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->notPath('appengine/wordpress/src/files/flexible/wp-config.php') + ->notPath('appengine/wordpress/src/files/standard/wp-config.php') + ->in(__DIR__) + ) +; diff --git a/appengine/flexible/analytics/app.php b/appengine/flexible/analytics/app.php index 4b2084585b..441edce334 100644 --- a/appengine/flexible/analytics/app.php +++ b/appengine/flexible/analytics/app.php @@ -1,6 +1,6 @@ sendMessage($mailgunDomain, array( + $postData = array( 'from' => sprintf('Example Sender ', $mailgunDomain), 'to' => $recipient, - 'cc' => $cc, - 'bcc' => $bcc, 'subject' => 'Hello', 'text' => 'Testing some Mailgun awesomeness!', 'html' => 'HTML version of the body', - ), array( + ); + + if ($cc) { + $postData['cc'] = $cc; + } + + if ($bcc) { + $postData['bcc'] = $bcc; + } + + // Make the call to the client. + $result = $mailgunClient->sendMessage($mailgunDomain, $postData, array( 'attachment' => array($fileAttachment, $fileAttachment), )); # [END complex_message] diff --git a/appengine/standard/mailgun/index.php b/appengine/standard/mailgun/index.php index 02b05de69f..1fc2c34391 100644 --- a/appengine/standard/mailgun/index.php +++ b/appengine/standard/mailgun/index.php @@ -1,6 +1,6 @@ recipient = getenv('MAILGUN_RECIPIENT'); - if (empty($mailgunDomain) || empty($mailgunApiKey)) { - $this->markTestSkipped('set the MAILGUN_DOMAIN and MAILGUN_APIKEY environment variables'); + if (empty($mailgunDomain) || empty($mailgunApiKey) || empty($this->recipient)) { + $this->markTestSkipped('set the MAILGUN_DOMAIN, MAILGUN_APIKEY ' . + 'and MAILGUN_RECIPIENT environment variables'); } $app['mailgun.domain'] = $mailgunDomain; @@ -58,7 +62,7 @@ public function testSimpleEmail() $client = $this->createClient(); $crawler = $client->request('POST', '/', [ - 'recipient' => 'fake@example.com', + 'recipient' => $this->recipient, 'submit' => 'simple', ]); @@ -72,7 +76,7 @@ public function testComplexEmail() $client = $this->createClient(); $crawler = $client->request('POST', '/', [ - 'recipient' => 'fake@example.com', + 'recipient' => $this->recipient, 'submit' => 'complex', ]); diff --git a/appengine/standard/mailjet/app.php b/appengine/standard/mailjet/app.php index 1aefa04840..fc5b3d9c58 100644 --- a/appengine/standard/mailjet/app.php +++ b/appengine/standard/mailjet/app.php @@ -1,6 +1,6 @@ query() ->kind('Task') - ->filter('description', '=', 'A task description.'); + ->filter('description', '=', 'A task description.'); // [END unindexed_property_query] return $query; } diff --git a/datastore/api/test/ConceptsTest.php b/datastore/api/test/ConceptsTest.php index 81ef42acfc..467e930893 100644 --- a/datastore/api/test/ConceptsTest.php +++ b/datastore/api/test/ConceptsTest.php @@ -1,12 +1,12 @@