Skip to content

Commit 1cf9ca8

Browse files
authored
Merge pull request #999 from lcharette/develop-feature-updatedDependencies
Update to the latest Laravel & Composer Packages
2 parents 35ec97c + 2de2df9 commit 1cf9ca8

22 files changed

Lines changed: 111 additions & 66 deletions

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1010
### Changed Requirements
1111
- Changed minimum PHP Version to 7.1
1212

13+
### Changed Dependencies
14+
- Updated Laravel Illuminate packages to 5.8
15+
- Updated Twig to 2.11
16+
- Updated PHPUnit to 7.5
17+
- Updated Mockery to 1.2
18+
- Updated nikic/php-parser to 4.2.2
19+
- Updated PHPMailer/PHPMailer to 6.0.7
20+
- Updated league/csv to 9.2.1
21+
- Updated symfony/console to 4.3
22+
- Updated vlucas/phpdotenv to 3.4.0
23+
1324
### Added
1425
- Separated `BakeCommand` class into multiple methods to make it easier for sprinkle to add custom command to the `bake` command.
1526

app/sprinkles/account/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
],
1414
"require": {
1515
"birke/rememberme" : "^2.0",
16-
"nikic/php-parser" : "^1"
16+
"nikic/php-parser" : "^4.2.2"
1717
},
1818
"autoload": {
1919
"psr-4": {

app/sprinkles/account/src/Authorize/AccessConditionExpression.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212

1313
use Monolog\Logger;
1414
use PhpParser\Error as PhpParserException;
15-
use PhpParser\Lexer\Emulative as EmulativeLexer;
1615
use PhpParser\NodeTraverser;
17-
use PhpParser\Parser as Parser;
16+
use PhpParser\ParserFactory as Parser;
1817
use PhpParser\PrettyPrinter\Standard as StandardPrettyPrinter;
1918
use UserFrosting\Sprinkle\Account\Database\Models\Interfaces\UserInterface;
2019

@@ -75,7 +74,7 @@ public function __construct(ParserNodeFunctionEvaluator $nodeVisitor, UserInterf
7574
{
7675
$this->nodeVisitor = $nodeVisitor;
7776
$this->user = $user;
78-
$this->parser = new Parser(new EmulativeLexer());
77+
$this->parser = (new Parser())->create(Parser::ONLY_PHP7);
7978
$this->traverser = new NodeTraverser();
8079
$this->traverser->addVisitor($nodeVisitor);
8180
$this->prettyPrinter = new StandardPrettyPrinter();
@@ -119,7 +118,7 @@ public function evaluateCondition($condition, $params)
119118
$stmts = $this->traverser->traverse($stmts);
120119

121120
// Evaluate boolean statement. It is safe to use eval() here, because our expression has been reduced entirely to a boolean expression.
122-
$expr = $this->prettyPrinter->prettyPrintExpr($stmts[0]);
121+
$expr = $this->prettyPrinter->prettyPrintExpr($stmts[0]->expr);
123122
$expr_eval = 'return ' . $expr . ";\n";
124123
$result = eval($expr_eval);
125124

app/sprinkles/account/src/Authorize/ParserNodeFunctionEvaluator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function leaveNode(Node $node)
7171
{
7272
// Look for function calls
7373
if ($node instanceof \PhpParser\Node\Expr\FuncCall) {
74-
$eval = new \PhpParser\Node\Scalar\LNumber();
74+
$eval = new \PhpParser\Node\Scalar\LNumber(0);
7575

7676
// Get the method name
7777
$callbackName = $node->name->toString();

app/sprinkles/core/composer.json

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,27 @@
3232
"illuminate/database": "5.8.*",
3333
"illuminate/events": "5.8.*",
3434
"illuminate/filesystem": "5.8.*",
35-
"league/csv": "^8.1",
35+
"league/csv": "^9.2.1",
3636
"league/flysystem": "~1.0",
3737
"league/flysystem-aws-s3-v3": "~1.0",
3838
"league/flysystem-cached-adapter": "~1.0",
3939
"league/flysystem-rackspace": "~1.0",
4040
"league/flysystem-sftp": "~1.0",
4141
"monolog/monolog": "^1",
42-
"phpmailer/phpmailer": "5.2.10",
43-
"rockettheme/toolbox": "1.3.1",
42+
"phpmailer/phpmailer": "^6.0.7",
4443
"slim/csrf": "^0.8",
4544
"slim/slim": "^3",
46-
"slim/twig-view": "^1.2",
45+
"slim/twig-view": "^2.5",
4746
"symfony/http-foundation": "*",
48-
"twig/twig": "^1.18",
49-
"userfrosting/assets": "^5.0.4",
50-
"userfrosting/config": "~4.2.0",
51-
"userfrosting/cache": "~4.2.0",
52-
"userfrosting/fortress": "~4.2.0",
53-
"userfrosting/i18n": "~4.2.0",
54-
"userfrosting/session": "~4.2.2",
55-
"userfrosting/support": "~4.2.0",
56-
"vlucas/phpdotenv": "^2"
47+
"twig/twig": "^2.11",
48+
"userfrosting/assets": "^6.0.0",
49+
"userfrosting/config": "~4.3.0",
50+
"userfrosting/cache": "~4.3.0",
51+
"userfrosting/fortress": "~4.3.0",
52+
"userfrosting/i18n": "~4.3.0",
53+
"userfrosting/session": "~4.3.0",
54+
"userfrosting/support": "~4.3.0",
55+
"vlucas/phpdotenv": "^3.4.0"
5756
},
5857
"autoload": {
5958
"files" : [

app/sprinkles/core/src/Bakery/MigrateCommand.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\Console\Input\InputOption;
1515
use Symfony\Component\Console\Output\OutputInterface;
1616
use UserFrosting\Sprinkle\Core\Bakery\Helper\ConfirmableTrait;
17+
use UserFrosting\Sprinkle\Core\Database\Migrator\Migrator;
1718
use UserFrosting\System\Bakery\BaseCommand;
1819

1920
/**
@@ -79,13 +80,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
7980
try {
8081
$migrated = $migrator->run(['pretend' => $pretend, 'step' => $step]);
8182
} catch (\Exception $e) {
82-
$this->io->writeln($migrator->getNotes());
83+
$this->displayNotes($migrator);
8384
$this->io->error($e->getMessage());
8485
exit(1);
8586
}
8687

8788
// Get notes and display them
88-
$this->io->writeln($migrator->getNotes());
89+
$this->displayNotes($migrator);
8990

9091
// If all went well, there's no fatal errors and we have migrated
9192
// something, show some success
@@ -128,4 +129,16 @@ protected function setupMigrator(InputInterface $input)
128129

129130
return $migrator;
130131
}
132+
133+
/**
134+
* Display migrator notes.
135+
*
136+
* @param Migrator $migrator
137+
*/
138+
protected function displayNotes(Migrator $migrator)
139+
{
140+
if (!empty($notes = $migrator->getNotes())) {
141+
$this->io->writeln($notes);
142+
}
143+
}
131144
}

app/sprinkles/core/src/Bakery/MigrateRefreshCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
7171
try {
7272
$rolledback = $migrator->rollback(['pretend' => false, 'steps' => $steps]);
7373
} catch (\Exception $e) {
74-
$this->io->writeln($migrator->getNotes());
74+
$this->displayNotes($migrator);
7575
$this->io->error($e->getMessage());
7676
exit(1);
7777
}
7878

7979
// Get notes and display them
80-
$this->io->writeln($migrator->getNotes());
80+
$this->displayNotes($migrator);
8181

8282
// Stop if nothing was rolledback
8383
if (empty($rolledback)) {
@@ -88,7 +88,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
8888

8989
// Run back up again
9090
$migrated = $migrator->run(['pretend' => false, 'step' => false]);
91-
$this->io->writeln($migrator->getNotes());
91+
$this->displayNotes($migrator);
9292

9393
// If all went well, there's no fatal errors and we have migrated
9494
// something, show some success

app/sprinkles/core/src/Bakery/MigrateResetCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ protected function performReset(InputInterface $input)
8787
try {
8888
$resetted = $migrator->reset($pretend);
8989
} catch (\Exception $e) {
90-
$this->io->writeln($migrator->getNotes());
90+
$this->displayNotes($migrator);
9191
$this->io->error($e->getMessage());
9292
exit(1);
9393
}
9494

9595
// Get notes and display them
96-
$this->io->writeln($migrator->getNotes());
96+
$this->displayNotes($migrator);
9797

9898
// Delete the repository
9999
if (!$pretend && $migrator->repositoryExists()) {

app/sprinkles/core/src/Bakery/MigrateRollbackCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
8080
$migrated = $migrator->rollback(['pretend' => $pretend, 'steps' => $steps]);
8181
}
8282
} catch (\Exception $e) {
83-
$this->io->writeln($migrator->getNotes());
83+
$this->displayNotes($migrator);
8484
$this->io->error($e->getMessage());
8585
exit(1);
8686
}
8787

8888
// Get notes and display them
89-
$this->io->writeln($migrator->getNotes());
89+
$this->displayNotes($migrator);
9090

9191
// If all went well, there's no fatal errors and we have migrated
9292
// something, show some success

app/sprinkles/core/src/Mail/Mailer.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
namespace UserFrosting\Sprinkle\Core\Mail;
1212

1313
use Monolog\Logger;
14+
use PHPMailer\PHPMailer\Exception as phpmailerException;
15+
use PHPMailer\PHPMailer\PHPMailer;
1416

1517
/**
1618
* Mailer Class.
@@ -37,14 +39,14 @@ class Mailer
3739
* @param Logger $logger A Monolog logger, used to dump debugging info for SMTP server transactions.
3840
* @param mixed[] $config An array of configuration parameters for phpMailer.
3941
*
40-
* @throws \phpmailerException Wrong mailer config value given.
42+
* @throws phpmailerException Wrong mailer config value given.
4143
*/
4244
public function __construct($logger, $config = [])
4345
{
4446
$this->logger = $logger;
4547

4648
// 'true' tells PHPMailer to use exceptions instead of error codes
47-
$this->phpMailer = new \PHPMailer(true);
49+
$this->phpMailer = new PHPMailer(true);
4850

4951
// Configuration options
5052
switch ($config['mailer']) {
@@ -79,7 +81,7 @@ public function __construct($logger, $config = [])
7981
}
8082
break;
8183
default:
82-
throw new \phpmailerException("'mailer' must be one of 'smtp', 'mail', 'qmail', or 'sendmail'.");
84+
throw new phpmailerException("'mailer' must be one of 'smtp', 'mail', 'qmail', or 'sendmail'.");
8385
}
8486

8587
// Set any additional message-specific options
@@ -97,7 +99,7 @@ public function __construct($logger, $config = [])
9799
/**
98100
* Get the underlying PHPMailer object.
99101
*
100-
* @return \PHPMailer
102+
* @return PHPMailer
101103
*/
102104
public function getPhpMailer()
103105
{
@@ -113,7 +115,7 @@ public function getPhpMailer()
113115
* @param MailMessage $message
114116
* @param bool $clearRecipients Set to true to clear the list of recipients in the message after calling send(). This helps avoid accidentally sending a message multiple times.
115117
*
116-
* @throws \phpmailerException The message could not be sent.
118+
* @throws phpmailerException The message could not be sent.
117119
*/
118120
public function send(MailMessage $message, $clearRecipients = true)
119121
{
@@ -163,7 +165,7 @@ public function send(MailMessage $message, $clearRecipients = true)
163165
* @param MailMessage $message
164166
* @param bool $clearRecipients Set to true to clear the list of recipients in the message after calling send(). This helps avoid accidentally sending a message multiple times.
165167
*
166-
* @throws \phpmailerException The message could not be sent.
168+
* @throws phpmailerException The message could not be sent.
167169
*/
168170
public function sendDistinct(MailMessage $message, $clearRecipients = true)
169171
{

0 commit comments

Comments
 (0)