FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
rector-src/scripts/add-phpstan-self-replace.php at main · rectorphp/rector-src · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
rectorphp
/
rector-src
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
447
Star
136
Code
Pull requests
4
Actions
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
rector-src
/
scripts
/
add-phpstan-self-replace.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
24 lines (15 loc) · 788 Bytes
Breadcrumbs
rector-src
/
scripts
/
add-phpstan-self-replace.php
Copy path
File metadata and controls
24 lines (15 loc) · 788 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
// this is part of downgrade build
declare
(strict_types=
1
);
use
Nette
\
Utils
\
FileSystem
;
use
Nette
\
Utils
\
Json
;
use
Rector
\
Composer
\
InstalledPackageResolver
;
require
__DIR__
.
'
/../vendor/autoload.php
'
;
$
composerJsonFileContents
= FileSystem::
read
(
__DIR__
.
'
/../composer.json
'
);
$
installedPackageResolver
=
new
InstalledPackageResolver
(
__DIR__
.
'
/..
'
);
$
phpstanVersion
=
$
installedPackageResolver
->
resolvePackageVersion
(
'
phpstan/phpstan
'
);
$
composerJson
= Json::
decode
(
$
composerJsonFileContents
, forceArrays:
true
);
$
composerJson
[
'
replace
'
][
'
phpstan/phpstan
'
] =
$
phpstanVersion
;
$
modifiedComposerJsonFileContents
= Json::
encode
(
$
composerJson
, pretty:
true
);
FileSystem::
write
(
__DIR__
.
'
/../composer.json
'
,
$
modifiedComposerJsonFileContents
,
null
);
echo
'
Done!
'
.
PHP_EOL
;
Back
|
FazBrowse Home
|
New Git URL