Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[TwigBridge] Remove $rootDir argument in CodeExtension #28967

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

Merged
merged 1 commit into from
Oct 25, 2018
Merged

[TwigBridge] Remove $rootDir argument in CodeExtension #28967

merged 1 commit into from
Oct 25, 2018

Conversation

ro0NL
Copy link
Contributor

@ro0NL ro0NL commented Oct 24, 2018

Q A
Branch? master
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets symfony/symfony-docs#10547 (comment)
License MIT
Doc PR symfony/symfony-docs#...

Forgotten in #28890

cc @javiereguiluz

* @param string $charset The charset
*/
public function __construct($fileLinkFormat, string $rootDir, string $charset, string $projectDir = null)
public function __construct($fileLinkFormat, string $projectDir, string $charset)
Copy link
Contributor Author

@ro0NL ro0NL Oct 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

argument was added in 4.2, so safe to remove technically.

We slightly change the behavior, only in formatFile. IMHO that's fine.

@chalasr chalasr added this to the 4.2 milestone Oct 24, 2018
@nicolas-grekas
Copy link
Member

can you have a look at the failure on Windows?

-'some/File.txt'
+'/some/File.txt'
C:\projects\symfony\src\Symfony\Bridge\Twig\Tests\Extension\CodeExtensionTest.php:28

@nicolas-grekas
Copy link
Member

and the failure on Travis btw - looks like the composer.json change allowed spotting an issue :)

@ro0NL
Copy link
Contributor Author

ro0NL commented Oct 24, 2018

Im not sure the appveyor failure is still related, looks like it's not.

@ro0NL
Copy link
Contributor Author

ro0NL commented Oct 24, 2018

The CodeHelper looks like

public function __construct($fileLinkFormat, string $projectDir, string $charset)
{
$this->fileLinkFormat = $fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
$this->rootDir = str_replace('\\', '/', $projectDir).'/';
$this->charset = $charset;
}

so i tend to keep the slash normalization actually =/

@fabpot
Copy link
Member

fabpot commented Oct 25, 2018

Thank you @ro0NL.

@fabpot fabpot merged commit f894724 into symfony:master Oct 25, 2018
fabpot added a commit that referenced this pull request Oct 25, 2018
…0NL)

This PR was merged into the 4.2-dev branch.

Discussion
----------

 [TwigBridge] Remove $rootDir argument in CodeExtension

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | symfony/symfony-docs#10547 (comment)
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Forgotten in #28890

cc @javiereguiluz

Commits
-------

f894724 [TwigBridge] Remove $rootDir argument in CodeExtension
@ro0NL ro0NL deleted the root_dir branch October 25, 2018 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants