dependabot-composer 0.111.18 → 0.111.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c4ad1299bb5744ee16c0310fd05385060be131bdf8385fb3e9fe28e48f44ded2
4
- data.tar.gz: f6886189fb4707416565b1934f63a164deeed5986737b70634f0064f84f0208c
3
+ metadata.gz: 0e522407c232a8fd30cbe85d1f65def39bcd72bc8cd0c9410e25f30b93536c63
4
+ data.tar.gz: 1e8d89a21f4b58083ba56517beaa99c9624d7c29b32ca28a4d56ce500b0bda4a
5
5
  SHA512:
6
- metadata.gz: 42e123d13601c38213f1f8668549caff6ef4a304df021d0b701d90bb1f7c743cb2b711862731c1317ab24ac49061d0e81dfdad2b7abe0f7c095ff0629dc87a86
7
- data.tar.gz: f268a0f14f5399c8a56013eb4f51806757259fbce6bc73d88c8293c778e5c76276b5522ea12d9b61b3a49e5712e5561abbf8acf26101a6632587e574f6a637d0
6
+ metadata.gz: 395b524a629bd8bd40cce8196d3b4d77f5bd7bbed1864cb5ce718ca3261e30efcdbd2b66344c01ba580bb39dbfc72c2539945c9668a794697199856aaf7eabe9
7
+ data.tar.gz: 8a1d56c2218d18c36611a311b5f392a23d4276f2bb2bafdd2b96d2e1a39f4de9c4f7a8d5967d012dacff3828ea0d48e0cebc3cb79a24c9d109e1660a0c427f4d
@@ -27,7 +27,7 @@ module Dependabot
27
27
  @dependencies = dependencies
28
28
  @dependency_files = dependency_files
29
29
  @credentials = credentials
30
- @composer_platform_extensions = {}
30
+ @composer_platform_extensions = initial_platform
31
31
  end
32
32
 
33
33
  def updated_lockfile_content
@@ -353,6 +353,17 @@ module Dependabot
353
353
  select { |cred| cred["password"] }
354
354
  end
355
355
 
356
+ def initial_platform
357
+ return {} unless parsed_composer_json["type"] == "library"
358
+ return {} unless parsed_composer_json.dig("require", "php")
359
+
360
+ { "php" => [parsed_composer_json.dig("require", "php")] }
361
+ end
362
+
363
+ def parsed_composer_json
364
+ JSON.parse(composer_json.content)
365
+ end
366
+
356
367
  def composer_json
357
368
  @composer_json ||=
358
369
  dependency_files.find { |f| f.name == "composer.json" }
@@ -32,7 +32,7 @@ module Dependabot
32
32
  @dependency_files = dependency_files
33
33
  @requirements_to_unlock = requirements_to_unlock
34
34
  @latest_allowable_version = latest_allowable_version
35
- @composer_platform_extensions = {}
35
+ @composer_platform_extensions = initial_platform
36
36
  end
37
37
 
38
38
  def latest_resolvable_version
@@ -276,6 +276,17 @@ module Dependabot
276
276
  NativeHelpers.composer_helper_path
277
277
  end
278
278
 
279
+ def initial_platform
280
+ return {} unless parsed_composer_file["type"] == "library"
281
+ return {} unless parsed_composer_file.dig("require", "php")
282
+
283
+ { "php" => [parsed_composer_file.dig("require", "php")] }
284
+ end
285
+
286
+ def parsed_composer_file
287
+ JSON.parse(composer_file.content)
288
+ end
289
+
279
290
  def composer_file
280
291
  @composer_file ||=
281
292
  dependency_files.find { |f| f.name == "composer.json" }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-composer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.111.18
4
+ version: 0.111.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.111.18
19
+ version: 0.111.19
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.111.18
26
+ version: 0.111.19
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement