Page MenuHomePhorge

Fix RuntimeException: min(): Array must contain at least one element
ClosedPublic

Authored by aklapper on Aug 22 2023, 09:09.
Tags
None
Referenced Files
F4117057: D25417.1746979478.diff
Sat, May 10, 16:04
F4116046: D25417.1746959006.diff
Sat, May 10, 10:23
F4076379: D25417.1746872854.diff
Fri, May 9, 10:27
F4059521: D25417.1746787247.diff
Thu, May 8, 10:40
F4036419: D25417.1746717489.diff
Wed, May 7, 15:18
F4036418: D25417.1746717488.diff
Wed, May 7, 15:18
F4036417: D25417.1746717487.diff
Wed, May 7, 15:18
F4036416: D25417.1746717486.diff
Wed, May 7, 15:18

Details

Summary

Make sure that $epochs[] is never empty but contains 0 so min($epochs) will not complain.

Closes T15623

Test Plan

Carefully read the code (as I am unaware of reproduction steps).

Diff Detail

Repository
rP Phorge
Branch
T15623min (branched from master)
Lint
Lint Passed
Unit
Test Failures
Build Status
Buildable 797
Build 797: arc lint + arc unit

Unit TestsFailed

TimeTest
229 msPhabricatorLibraryTestCase::testLibraryMap
Assertion failed, expected 'true' (at PhutilLibraryTestCase.php:45): The library map is out of date. Rebuild it with `arc liberate`. These entries differ: class.PhabricatorProjectDescriptionTransaction, xmap.PhabricatorProjectDescriptionTransaction.
76 msDiffusionServeControllerTestCase::testHandleRequest
2 assertions passed.
204 msPhabricatorCelerityTestCase::testCelerityMaps
1 assertion passed.
12 msPhabricatorConduitTestCase::testConduitMethods
1 assertion passed.
0 msPhabricatorInfrastructureTestCase::testApplicationsInstalled
1 assertion passed.
View Full Test Results (1 Failed · 7 Passed)

Event Timeline

Obviously not a clean tree, sorry. Thus ran arc liberate, now arc asked whether to include unstaged changes in src/__phutil_library_map__.php (yes)

and that's now wrong because src/__phutil_library_map__.php includes a non-existing file though I had ran git stash. I love git...

Try again, after an rm and arc liberate on master, and then a git rebase master on this branch

This revision is now accepted and ready to land.Aug 22 2023, 09:27